Navic
info
You can enable the extra with the :LazyExtras
command.
Plugins marked as optional will only be configured if they are installed.
Alternatively, you can add it to your lazy.nvim
imports
lua/config/lazy.lua
require("lazy").setup({
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "lazyvim.plugins.extras.editor.navic" },
{ import = "plugins" },
},
})
Below you can find a list of included plugins and their default settings.
caution
You don't need to copy the default settings to your config. They are only shown here for reference.
nvim-navic
lsp symbol navigation for lualine. This shows where in the code structure you are - within functions, classes, etc - in the statusline.
- Options
- Full Spec
opts = function()
return {
separator = " ",
highlight = true,
depth_limit = 5,
icons = LazyVim.config.icons.kinds,
lazy_update_context = true,
}
end
{
"SmiteshP/nvim-navic",
lazy = true,
init = function()
vim.g.navic_silence = true
LazyVim.lsp.on_attach(function(client, buffer)
if client.supports_method("textDocument/documentSymbol") then
require("nvim-navic").attach(client, buffer)
end
end)
end,
opts = function()
return {
separator = " ",
highlight = true,
depth_limit = 5,
icons = LazyVim.config.icons.kinds,
lazy_update_context = true,
}
end,
}
lualine.nvim (optional)
lualine integration
- Options
- Full Spec
opts = function(_, opts)
if not vim.g.trouble_lualine then
table.insert(opts.sections.lualine_c, { "navic", color_correction = "dynamic" })
end
end
{
"nvim-lualine/lualine.nvim",
optional = true,
opts = function(_, opts)
if not vim.g.trouble_lualine then
table.insert(opts.sections.lualine_c, { "navic", color_correction = "dynamic" })
end
end,
}