rj1
log | files | refs
commit 9b102f2320f45f827b20457f7883825d18c77853
parent 0c531faca335b950d6b2855ce7618fb516a987f6
author: rj1 <[email protected]>
date:   Sat, 18 May 2024 11:40:02 -0600

nvim: add navic plugin to show documentSymbols in lualine

Diffstat:
M.config/nvim/lua/rj1/lsp.lua | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
M.config/nvim/lua/rj1/lualine.lua | 7+++++++
M.config/nvim/lua/rj1/plugins.lua | 2++
3 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/.config/nvim/lua/rj1/lsp.lua b/.config/nvim/lua/rj1/lsp.lua @@ -28,7 +28,58 @@ local border = { { "🭼", "FloatBorder" }, { "▏", "FloatBorder" }, } + +local navic = require("nvim-navic") +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 = false, + preference = nil, + }, + highlight = false, + separator = " ➔ ", + depth_limit = 0, + depth_limit_indicator = "..", + safe_output = true, + lazy_update_context = false, + click = false, + format_text = function(text) + return text + end, +} local on_attach = function(_, buffer) + + if _.server_capabilities.documentSymbolProvider then + navic.attach(_, buffer) + end + -- goto definition vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = buffer }) diff --git a/.config/nvim/lua/rj1/lualine.lua b/.config/nvim/lua/rj1/lualine.lua @@ -25,6 +25,8 @@ local function lsp_servers() return table.concat(servers, ", ") end +local navic = require("nvim-navic") + -- lualine require("lualine").setup({ options = { @@ -79,6 +81,11 @@ require("lualine").setup({ return { fg = colors.purple } end, }, + { + "navic", + color_correction = nil, + navic_opts = nil + } --[[ { Codeium_status, icon = "󰧑 ai:", diff --git a/.config/nvim/lua/rj1/plugins.lua b/.config/nvim/lua/rj1/plugins.lua @@ -26,6 +26,8 @@ require("lazy").setup({ "andersevenrud/cmp-tmux", "microsoft/python-type-stubs", "rafamadriz/friendly-snippets", + "SmiteshP/nvim-navic", + -- db "tpope/vim-dadbod", "kristijanhusak/vim-dadbod-ui",