diff --git a/.config/nvim/lua/brian/lsp.lua b/.config/nvim/lua/brian/lsp.lua index 359f7b8..350e84d 100644 --- a/.config/nvim/lua/brian/lsp.lua +++ b/.config/nvim/lua/brian/lsp.lua @@ -45,7 +45,23 @@ vim.api.nvim_create_autocmd('LspAttach', { end, opts) -- jump to next diagnostic in buffer opts.desc = 'Show documentation for what is under cursor' - keymap.set('n', 'K', vim.lsp.buf.hover, opts) -- show documentation for what is under cursor + keymap.set('n', 'K', function() + vim.lsp.buf.hover { border = 'rounded' } + end, opts) + + opts.desc = 'Scroll hover docs down' + keymap.set('n', '', function() + if not require('noice.lsp').scroll(4) then + return '' + end + end, { buffer = ev.buf, silent = true, expr = true }) + + opts.desc = 'Scroll hover docs up' + keymap.set('n', '', function() + if not require('noice.lsp').scroll(-4) then + return '' + end + end, { buffer = ev.buf, silent = true, expr = true }) opts.desc = 'Restart LSP' keymap.set('n', 'rs', ':LspRestart', opts) -- mapping to restart lsp if necessary diff --git a/.config/nvim/lua/brian/plugins/noice.lua b/.config/nvim/lua/brian/plugins/noice.lua index 405a09b..9ae984a 100644 --- a/.config/nvim/lua/brian/plugins/noice.lua +++ b/.config/nvim/lua/brian/plugins/noice.lua @@ -17,7 +17,7 @@ return { command_palette = true, -- position the cmdline and popupmenu together long_message_to_split = true, -- long messages will be sent to a split inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help + lsp_doc_border = true, -- add a border to hover docs and signature help }, }, dependencies = {