feat(navic): moved navic to extras
This commit is contained in:
42
lua/lazyvim/plugins/extras/editor/navic.lua
Normal file
42
lua/lazyvim/plugins/extras/editor/navic.lua
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
return {
|
||||||
|
-- lsp symbol navigation for lualine. This shows where
|
||||||
|
-- in the code structure you are - within functions, classes,
|
||||||
|
-- etc - in the statusline.
|
||||||
|
{
|
||||||
|
"SmiteshP/nvim-navic",
|
||||||
|
lazy = true,
|
||||||
|
init = function()
|
||||||
|
vim.g.navic_silence = true
|
||||||
|
require("lazyvim.util").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 = require("lazyvim.config").icons.kinds,
|
||||||
|
lazy_update_context = true,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lualine integration
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sections.lualine_c, {
|
||||||
|
function()
|
||||||
|
return require("nvim-navic").get_location()
|
||||||
|
end,
|
||||||
|
cond = function()
|
||||||
|
return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -141,8 +141,6 @@ return {
|
|||||||
{ "filename", path = 1, symbols = { modified = " ", readonly = "", unnamed = "" } },
|
{ "filename", path = 1, symbols = { modified = " ", readonly = "", unnamed = "" } },
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
{
|
{
|
||||||
function() return require("nvim-navic").get_location() end,
|
|
||||||
cond = function() return package.loaded["nvim-navic"] and require("nvim-navic").is_available() end,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
@ -308,31 +306,6 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- lsp symbol navigation for lualine. This shows where
|
|
||||||
-- in the code structure you are - within functions, classes,
|
|
||||||
-- etc - in the statusline.
|
|
||||||
{
|
|
||||||
"SmiteshP/nvim-navic",
|
|
||||||
lazy = true,
|
|
||||||
init = function()
|
|
||||||
vim.g.navic_silence = true
|
|
||||||
require("lazyvim.util").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 = require("lazyvim.config").icons.kinds,
|
|
||||||
lazy_update_context = true,
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- icons
|
-- icons
|
||||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user