feat: noice.nvim

This commit is contained in:
punkfairie 2024-11-30 17:40:46 -08:00
parent 56e2cdbc0c
commit 4b7f012fc1
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696
5 changed files with 114 additions and 0 deletions

View file

@ -35,6 +35,7 @@ with final.pkgs.lib; let
# Util
plenary-nvim
nui-nvim
# Colorscheme
rose-pine
@ -44,6 +45,7 @@ with final.pkgs.lib; let
alpha-nvim
bufferline-nvim
lualine-nvim
noice-nvim
indent-blankline-nvim
];

View file

@ -6,4 +6,5 @@ return {
req('indent-blankline-nvim'),
req('lualine-nvim'),
req('mini-icons'),
req('noice-nvim'),
}

View file

@ -0,0 +1,106 @@
return {
'noice.nvim',
event = 'DeferredUIEnter',
keys = {
{ '<LEADER>nn', '', desc = '+notifications' },
{
'<S-ENTER>',
function()
require('noice').redirect(vim.fn.getcmdline())
end,
mode = 'c',
desc = 'Redirect cmdline',
},
{
'<LEADER>nl',
function()
require('noice').cmd('last')
end,
desc = 'Last message',
},
{
'<LEADER>nh',
function()
require('noice').cmd('history')
end,
desc = 'Message history',
},
{
'<LEADER>na',
function()
require('noice').cmd('all')
end,
desc = 'All messages',
},
{
'<LEADER>nd',
function()
require('noice').cmd('dismiss')
end,
desc = 'Dismiss all',
},
{
'<LEADER>nt',
function()
require('noice').cmd('pick')
end,
desc = 'Message picker',
},
{
'<C-f>',
function()
if not require('noice.lsp').scroll(4) then
return '<C-f>'
end
end,
mode = { 'i', 'n', 's' },
silent = true,
expr = true,
desc = 'Scroll forward',
},
{
'<C-b>',
function()
if not require('noice.lsp').scroll(-4) then
return '<C-b>'
end
end,
mode = { 'i', 'n', 's' },
silent = true,
expr = true,
desc = 'Scroll backward',
},
},
before = function()
require('lz.n').trigger_load('nui.nvim')
end,
after = function()
require('noice').setup({
lsp = {
override = {
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
['vim.lsp.util.stylize_markdown'] = true,
['cmp.entry.get_documentation'] = true,
},
},
routes = {
{
filter = {
event = 'msg_show',
any = {
{ find = '%d+L, %d+B' },
{ find = '; after #%d+' },
{ find = '; before #%d+' },
},
},
view = 'mini',
},
},
presets = {
command_palette = true,
long_message_to_split = true,
lsp_doc_border = true,
},
})
end,
}

View file

@ -1,5 +1,6 @@
local req = require('lib.marleyvim').localRequire('plugins.util')
return {
req('nui-nvim'),
req('plenary'),
}

View file

@ -0,0 +1,4 @@
return {
'nui.nvim',
lazy = true,
}