diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index d3927e3..580146e 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -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 ]; diff --git a/nvim/lua/plugins/ui/init.lua b/nvim/lua/plugins/ui/init.lua index 584d59c..8ae3a63 100644 --- a/nvim/lua/plugins/ui/init.lua +++ b/nvim/lua/plugins/ui/init.lua @@ -6,4 +6,5 @@ return { req('indent-blankline-nvim'), req('lualine-nvim'), req('mini-icons'), + req('noice-nvim'), } diff --git a/nvim/lua/plugins/ui/noice-nvim.lua b/nvim/lua/plugins/ui/noice-nvim.lua new file mode 100644 index 0000000..8167523 --- /dev/null +++ b/nvim/lua/plugins/ui/noice-nvim.lua @@ -0,0 +1,106 @@ +return { + 'noice.nvim', + event = 'DeferredUIEnter', + keys = { + { 'nn', '', desc = '+notifications' }, + { + '', + function() + require('noice').redirect(vim.fn.getcmdline()) + end, + mode = 'c', + desc = 'Redirect cmdline', + }, + { + 'nl', + function() + require('noice').cmd('last') + end, + desc = 'Last message', + }, + { + 'nh', + function() + require('noice').cmd('history') + end, + desc = 'Message history', + }, + { + 'na', + function() + require('noice').cmd('all') + end, + desc = 'All messages', + }, + { + 'nd', + function() + require('noice').cmd('dismiss') + end, + desc = 'Dismiss all', + }, + { + 'nt', + function() + require('noice').cmd('pick') + end, + desc = 'Message picker', + }, + { + '', + function() + if not require('noice.lsp').scroll(4) then + return '' + end + end, + mode = { 'i', 'n', 's' }, + silent = true, + expr = true, + desc = 'Scroll forward', + }, + { + '', + function() + if not require('noice.lsp').scroll(-4) then + return '' + 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, +} diff --git a/nvim/lua/plugins/util/init.lua b/nvim/lua/plugins/util/init.lua index 69fc0eb..ce91954 100644 --- a/nvim/lua/plugins/util/init.lua +++ b/nvim/lua/plugins/util/init.lua @@ -1,5 +1,6 @@ local req = require('lib.marleyvim').localRequire('plugins.util') return { + req('nui-nvim'), req('plenary'), } diff --git a/nvim/lua/plugins/util/nui-nvim.lua b/nvim/lua/plugins/util/nui-nvim.lua new file mode 100644 index 0000000..0b09579 --- /dev/null +++ b/nvim/lua/plugins/util/nui-nvim.lua @@ -0,0 +1,4 @@ +return { + 'nui.nvim', + lazy = true, +}