marleyvim/nvim/lua/plugins/ui/noice-nvim.lua
2024-11-30 17:40:46 -08:00

106 lines
2.2 KiB
Lua

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,
}