mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
feat(extras): added extra for symbols-outline.nvim
This commit is contained in:
parent
f64039f546
commit
b4ba5d881d
2 changed files with 55 additions and 9 deletions
55
lua/lazyvim/plugins/extras/editor/symbols-outline.lua
Normal file
55
lua/lazyvim/plugins/extras/editor/symbols-outline.lua
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"simrat39/symbols-outline.nvim",
|
||||||
|
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||||
|
cmd = "SymbolsOutline",
|
||||||
|
opts = function()
|
||||||
|
local Config = require("lazyvim.config")
|
||||||
|
local defaults = require("symbols-outline.config").defaults
|
||||||
|
local opts = {
|
||||||
|
symbols = {},
|
||||||
|
symbol_blacklist = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
for kind, symbol in pairs(defaults.symbols) do
|
||||||
|
opts.symbols[kind] = {
|
||||||
|
icon = Config.icons.kinds[kind] or symbol.icon,
|
||||||
|
hl = symbol.hl,
|
||||||
|
}
|
||||||
|
if not vim.tbl_contains(Config.kind_filter.default, kind) then
|
||||||
|
table.insert(opts.symbol_blacklist, kind)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return opts
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- edgy integration
|
||||||
|
{
|
||||||
|
"folke/edgy.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local edgy_idx = Util.plugin.extra_idx("ui.edgy")
|
||||||
|
local symbols_idx = Util.plugin.extra_idx("editor.symbols-outline")
|
||||||
|
|
||||||
|
if edgy_idx and edgy_idx > symbols_idx then
|
||||||
|
Util.warn(
|
||||||
|
"The `edgy.nvim` extra must be **imported** before the `symbols-outline.nvim` extra to work properly.",
|
||||||
|
{
|
||||||
|
title = "LazyVim",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
opts.right = opts.right or {}
|
||||||
|
table.insert(opts.right, {
|
||||||
|
title = "Symbols Outline",
|
||||||
|
ft = "Outline",
|
||||||
|
pinned = true,
|
||||||
|
open = "SymbolsOutline",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
|
@ -105,15 +105,6 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
local Util = require("lazyvim.util")
|
|
||||||
if Util.has("symbols-outline.nvim") then
|
|
||||||
table.insert(opts.left, {
|
|
||||||
title = "Outline",
|
|
||||||
ft = "Outline",
|
|
||||||
pinned = true,
|
|
||||||
open = "SymbolsOutline",
|
|
||||||
})
|
|
||||||
end
|
|
||||||
return opts
|
return opts
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue