diff --git a/lua/cosmic/core/pluginsInit.lua b/lua/cosmic/core/pluginsInit.lua index 5600c64..17a6b4c 100644 --- a/lua/cosmic/core/pluginsInit.lua +++ b/lua/cosmic/core/pluginsInit.lua @@ -93,14 +93,6 @@ return packer.startup(function() disable = vim.tbl_contains(user_config.disable_builtin_plugins, 'null-ls'), after = 'nvim-lspconfig', }, - { - 'ray-x/lsp_signature.nvim', - config = function() - require('cosmic.plugins.lsp-signature') - end, - after = 'nvim-lspconfig', - disable = vim.tbl_contains(user_config.disable_builtin_plugins, 'lsp_signature'), - }, }, event = 'BufWinEnter', }) diff --git a/lua/cosmic/lsp/init.lua b/lua/cosmic/lsp/init.lua index f11e0ac..a42e103 100644 --- a/lua/cosmic/lsp/init.lua +++ b/lua/cosmic/lsp/init.lua @@ -1,14 +1,15 @@ -local config = require('cosmic.core.user') - -- set up lsp servers require('cosmic.lsp.providers') require('cosmic.lsp.diagnostics') require('cosmic.lsp.commands') -vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { - border = config.border, -}) - -vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { - border = config.border, -}) +-- currently handled by noice +-- +--[[ local config = require('cosmic.core.user') ]] +--[[ vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { ]] +--[[ border = config.border, ]] +--[[ }) ]] +--[[]] +--[[ vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { ]] +--[[ border = config.border, ]] +--[[ }) ]] diff --git a/lua/cosmic/plugins/noice/init.lua b/lua/cosmic/plugins/noice/init.lua index 76af100..07a44a1 100644 --- a/lua/cosmic/plugins/noice/init.lua +++ b/lua/cosmic/plugins/noice/init.lua @@ -1,11 +1,23 @@ require('noice').setup({ - lsp = { - hover = { - enabled = false, + views = { + notify = { + merge = true, }, - signature = { - enabled = false, - auto_open = false, -- Automatically show signature help when typing a trigger character from the LSP + hover = { + border = { + style = 'rounded', + }, + position = { row = 2, col = 2 }, + }, + }, + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + ['vim.lsp.util.stylize_markdown'] = true, + ['cmp.entry.get_documentation'] = true, }, }, }) + +require('cosmic.plugins.noice.mappings') diff --git a/lua/cosmic/plugins/noice/mappings.lua b/lua/cosmic/plugins/noice/mappings.lua new file mode 100644 index 0000000..429ae04 --- /dev/null +++ b/lua/cosmic/plugins/noice/mappings.lua @@ -0,0 +1,17 @@ +vim.keymap.set('n', '<c-f>', function() + if not require('noice.lsp').scroll(4) then + return '<c-f>' + end +end, { + silent = true, + expr = true, +}) + +vim.keymap.set('n', '<c-b>', function() + if not require('noice.lsp').scroll(-4) then + return '<c-b>' + end +end, { + silent = true, + expr = true, +})