diff --git a/nvim/lua/kogakure/lsp/handlers.lua b/nvim/lua/kogakure/lsp/handlers.lua index d67a4b7..6696de7 100644 --- a/nvim/lua/kogakure/lsp/handlers.lua +++ b/nvim/lua/kogakure/lsp/handlers.lua @@ -1,5 +1,7 @@ local M = {} +local navic = require("nvim-navic") + M.setup = function() local signs = { { name = "DiagnosticSignError", text = "" }, @@ -106,6 +108,10 @@ M.on_attach = function(client, bufnr) }) end + if client.server_capabilities.documentSymbolProvider then + navic.attach(client, bufnr) + end + -- TypeScript if client.name == "tsserver" then client.server_capabilities.documentFormattingProvider = false @@ -158,6 +164,9 @@ if not status_ok then return end +-- Set Winbar to nvim-static +vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}" + M.capabilities = cmp_nvim_lsp.default_capabilities(capabilities) return M diff --git a/nvim/lua/kogakure/plugins.lua b/nvim/lua/kogakure/plugins.lua index 0e1fea6..283a0dd 100644 --- a/nvim/lua/kogakure/plugins.lua +++ b/nvim/lua/kogakure/plugins.lua @@ -143,6 +143,7 @@ return packer.startup(function(use) use("ray-x/sad.nvim") -- Find & Replace use("gorbit99/codewindow.nvim") -- Minimap use("simrat39/symbols-outline.nvim") -- Symbols Outline + use("SmiteshP/nvim-navic") -- Statusline current context -- Editing Files use("windwp/nvim-autopairs") -- Autopairs, integrates with both cmp and treesitter