diff --git a/common/.config/nvim/lua/lsp-general.lua b/common/.config/nvim/lua/lsp-general.lua index 4dd7371..8fe96ad 100644 --- a/common/.config/nvim/lua/lsp-general.lua +++ b/common/.config/nvim/lua/lsp-general.lua @@ -51,21 +51,31 @@ lsp.setup_nvim_cmp({ lsp.on_attach(function(_, bufnr) vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + local opts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set('n', 'gD', 'lua vim.lsp.buf.definition()', opts) - vim.keymap.set('n', 'gT', 'lua vim.lsp.buf.type_definition()', opts) - vim.keymap.set('n', 'gI', 'lua vim.lsp.buf.implementation()', opts) - vim.keymap.set('n', 'gR', 'lua vim.lsp.buf.references()', opts) + vim.keymap.set('n', 'gD', 'lua vim.lsp.buf.definition()', opts) + vim.keymap.set('n', 'gT', 'lua vim.lsp.buf.type_definition()', opts) + vim.keymap.set('n', 'gR', 'lua vim.lsp.buf.references()', opts) - vim.keymap.set('n', '', 'lua vim.lsp.buf.code_action()', opts) + -- action & rename + vim.keymap.set('n', '', 'Lspsaga code_action', opts) + vim.keymap.set('n', 'gr', 'Lspsaga rename', opts) - -- Glance LSP - vim.keymap.set('n', 'gd', 'Glance definitions', opts) - vim.keymap.set('n', 'gt', 'Glance type_definitions', opts) - vim.keymap.set('n', 'gi', 'Glance implementations', opts) - vim.keymap.set('n', 'gr', 'Glance references', opts) + -- overwrite the defaults + vim.keymap.set('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + vim.keymap.set('n', 'K', 'Lspsaga hover_doc', opts) - vim.keymap.set('n', 'gf', 'lua vim.lsp.buf.format()', opts) + -- jump forward/backward up/down the call list + vim.keymap.set('n', 'gI', 'Lspsaga incoming_calls', opts) + vim.keymap.set('n', 'gO', 'Lspsaga outgoing_calls', opts) + + -- Sexy LSP + vim.keymap.set('n', 'gd', 'Lspsaga peek_definition', opts) + vim.keymap.set('n', 'gt', 'Lspsaga peek_type_definition', opts) + vim.keymap.set('n', 'gr', 'Lspsaga lsp_finder', opts) + + -- CLANGFORMATTTTT + vim.keymap.set('n', 'gf', 'lua vim.lsp.buf.format()', opts) end) diff --git a/common/.config/nvim/lua/plugins.lua b/common/.config/nvim/lua/plugins.lua index 1233547..cb056d5 100644 --- a/common/.config/nvim/lua/plugins.lua +++ b/common/.config/nvim/lua/plugins.lua @@ -128,12 +128,15 @@ local packer = require('packer').startup(function(use) } -- vscode like LSP code previews - use({ - 'dnlhc/glance.nvim', + use { + "glepnir/lspsaga.nvim", + opt = true, + branch = "main", + event = "LspAttach", config = function() - require('glance').setup({}) - end - }) + require("lspsaga").setup({}) + end, + } -- whitespace pedantics use 'ntpeters/vim-better-whitespace'