diff --git a/lua/lazyvim/plugins/extras/editor/symbols-outline.lua b/lua/lazyvim/plugins/extras/editor/symbols-outline.lua new file mode 100644 index 00000000..f0b0ba92 --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/symbols-outline.lua @@ -0,0 +1,55 @@ +local Util = require("lazyvim.util") + +return { + { + "simrat39/symbols-outline.nvim", + keys = { { "cs", "SymbolsOutline", 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, + }, +} diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index 8692d481..64e6237a 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -105,15 +105,6 @@ return { 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 end, },