diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 8a2edaf..7038450 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -35,7 +35,13 @@ return { -- and will be called for each installed server that doesn't have -- a dedicated handler. function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup({}) + require("lspconfig")[server_name].setup({ + on_attach = function(client, bufnr) + if client.server_capabilities["documentSymbolProvider"] then + require("nvim-navic").attach(client, bufnr) + end + end, + }) end, } diff --git a/lua/plugins/navic.lua b/lua/plugins/navic.lua new file mode 100644 index 0000000..f8fb0a6 --- /dev/null +++ b/lua/plugins/navic.lua @@ -0,0 +1,25 @@ +return { + { + "SmiteshP/nvim-navic", + dependencies = { + "neovim/nvim-lspconfig", + }, + opts = { + depth_limit_indicator = "...", + depth_limit = 8, + click = true, + }, + }, + { + "utilyre/barbecue.nvim", + name = "barbecue", + version = "*", + dependencies = { + "SmiteshP/nvim-navic", + "nvim-tree/nvim-web-devicons", + }, + opts = { + attach_navic = false, + }, + }, +}