diff options
Diffstat (limited to 'lua/plugins/navic.lua')
| -rwxr-xr-x[-rw-r--r--] | lua/plugins/navic.lua | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/lua/plugins/navic.lua b/lua/plugins/navic.lua index a95485d..a574d5c 100644..100755 --- a/lua/plugins/navic.lua +++ b/lua/plugins/navic.lua @@ -1,50 +1,51 @@ -local navic = require("nvim-navic") ---local on_attach = function(client, bufnr) --- if client.server_capabilities.documentSymbolProvider then --- navic.attach(client, bufnr) --- end ---end +local M = {} ---require("lspconfig").clangd.setup { --- on_attach = on_attach ---} +function M.setup() + local ok, navic = pcall(require, "nvim-navic") + if not ok or not navic then + return false + end -navic.setup { - icons = { - File = " ", - Module = " ", - Namespace = " ", - Package = " ", - Class = " ", - Method = " ", - Property = " ", - Field = " ", - Constructor = " ", - Enum = "練", - Interface = "練", - Function = " ", - Variable = " ", - Constant = " ", - String = " ", - Number = " ", - Boolean = "◩ ", - Array = " ", - Object = " ", - Key = " ", - Null = "ﳠ ", - EnumMember = " ", - Struct = " ", - Event = " ", - Operator = " ", - TypeParameter = " ", - }, - lsp = { - auto_attach = true, - --preference = nil, - }, - highlight = false, - separator = " > ", - depth_limit = 0, - depth_limit_indicator = "..", - safe_output = true -} + navic.setup({ + icons = { + File = " ", + Module = " ", + Namespace = " ", + Package = " ", + Class = " ", + Method = " ", + Property = " ", + Field = " ", + Constructor = " ", + Enum = "練", + Interface = "練", + Function = " ", + Variable = " ", + Constant = " ", + String = " ", + Number = " ", + Boolean = "◩ ", + Array = " ", + Object = " ", + Key = " ", + Null = "ﳠ ", + EnumMember = " ", + Struct = " ", + Event = " ", + Operator = " ", + TypeParameter = " " + }, + highlight = false, + separator = " > ", + depth_limit = 0, + depth_limit_indicator = "..", + safe_output = true, + lsp = { + auto_attach = true + } + }) + + return true +end + +return M |
