chore: decouple navbuddy from lsp

This commit is contained in:
Matej Janezic 2023-05-18 11:48:52 +02:00
parent e2926f4c54
commit faf3b36275
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
3 changed files with 16 additions and 16 deletions

View File

@ -37,10 +37,6 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
-- Plugins
vim.keymap.set('n', '<leader>nb', ':Navbuddy<CR>', { desc = '[N]av[b]uddy' })
vim.keymap.set('n', '<leader>nt', ':NvimTreeToggle<CR>', { desc = '[N]vim[T]ree' })
-- terminal keymaps
function _G.set_terminal_keymaps()
local opts = { buffer = 0 }

View File

@ -1,4 +1,4 @@
local on_attach = function(client, bufnr)
local on_attach = function(_, bufnr)
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
@ -10,8 +10,6 @@ local on_attach = function(client, bufnr)
vim.lsp.buf.format { timeout_ms = 2000 }
end
require('nvim-navbuddy').attach(client, bufnr)
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('<leader>ff', delayed_format, '[F]ormat')
@ -50,15 +48,6 @@ return {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
{
'SmiteshP/nvim-navbuddy',
dependencies = {
'neovim/nvim-lspconfig',
'SmiteshP/nvim-navic',
'MunifTanjim/nui.nvim',
},
},
-- adds extra functionality over rust_analyzer
'simrat39/rust-tools.nvim',

15
lua/plugins/navbuddy.lua Normal file
View File

@ -0,0 +1,15 @@
return {
'SmiteshP/nvim-navbuddy',
dependencies = {
'neovim/nvim-lspconfig',
'SmiteshP/nvim-navic',
'MunifTanjim/nui.nvim',
},
config = function()
require('nvim-navbuddy').setup { lsp = { auto_attach = true } }
-- Plugins
vim.keymap.set('n', '<leader>nb', ':Navbuddy<CR>', { desc = '[N]av[b]uddy' })
vim.keymap.set('n', '<leader>nt', ':NvimTreeToggle<CR>', { desc = '[N]vim[T]ree' })
end,
}