diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 3a60688..ef5efef 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -36,6 +36,7 @@ "nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" }, "nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" }, "nvim-lspconfig": { "branch": "master", "commit": "d70633830acf605ec03d9728698d9e7232442eb4" }, + "nvim-navbuddy": { "branch": "master", "commit": "f22bac988f2dd073601d75ba39ea5636ab6e38cb" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "632024157d01e8bc48fd7df6a7de8ffe3fdd4f3a" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, diff --git a/nvim/lua/themystery/plugins/lsp.lua b/nvim/lua/themystery/plugins/lsp.lua index 348419b..8ffe7f5 100644 --- a/nvim/lua/themystery/plugins/lsp.lua +++ b/nvim/lua/themystery/plugins/lsp.lua @@ -27,6 +27,7 @@ return { -- extras "SmiteshP/nvim-navic", + "SmiteshP/nvim-navbuddy", "Decodetalkers/csharpls-extended-lsp.nvim", -- rust @@ -122,12 +123,15 @@ return { local navic = require("nvim-navic") + local navbuddy = require("nvim-navbuddy") + lsp.on_attach(function(client, bufnr) local opts = { buffer = bufnr, remap = false } lsp.default_keymaps({ buffer = bufnr }) vim.lsp.inlay_hint.enable(true) if client.server_capabilities.documentSymbolProvider then navic.attach(client, bufnr) + navbuddy.attach(client, bufnr) end vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) vim.keymap.set("n", "dc", function() vim.lsp.buf.hover() end, opts) @@ -137,11 +141,13 @@ return { vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) -- for the code action key map to work you need to change key binding('.' symbol) of your terminal, otherwise it won't work vim.keymap.set("n", "", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "drr", function() vim.lsp.buf.references() end, opts) vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) -- sometimes lsp fails, we can restart it with this keymap vim.keymap.set('n', "lr", vim.cmd.LspRestart, opts) + + vim.keymap.set("n", "nv", function() navbuddy.open() end, opts) end) require("mason").setup({}); @@ -172,7 +178,7 @@ return { float = { style = 'minimal', border = 'rounded', - source = 'always', + source = true, header = '', prefix = '', },