Files
LazyVim/lua/lazyvim/plugins/extras/editor/outline.lua
2024-06-16 15:35:38 +02:00

69 lines
1.8 KiB
Lua

return {
-- Disable `<leader>cs` keymap so it doesn't conflict with `outline.nvim`
{
"folke/trouble.nvim",
optional = true,
keys = {
{ "<leader>cs", false },
},
},
{
"hedyhli/outline.nvim",
keys = { { "<leader>cs", "<cmd>Outline<cr>", desc = "Toggle Outline" } },
cmd = "Outline",
opts = function()
local defaults = require("outline.config").defaults
local opts = {
symbols = {},
symbol_blacklist = {},
keymaps = {
up_and_jump = "<up>",
down_and_jump = "<down>",
},
}
local filter = LazyVim.config.kind_filter
if type(filter) == "table" then
filter = filter.default
if type(filter) == "table" then
for kind, symbol in pairs(defaults.symbols) do
opts.symbols[kind] = {
icon = LazyVim.config.icons.kinds[kind] or symbol.icon,
hl = symbol.hl,
}
if not vim.tbl_contains(filter, kind) then
table.insert(opts.symbol_blacklist, kind)
end
end
end
end
return opts
end,
},
-- edgy integration
{
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
local edgy_idx = LazyVim.plugin.extra_idx("ui.edgy")
local symbols_idx = LazyVim.plugin.extra_idx("editor.outline")
if edgy_idx and edgy_idx > symbols_idx then
LazyVim.warn(
"The `edgy.nvim` extra must be **imported** before the `outline.nvim` extra to work properly.",
{ title = "LazyVim" }
)
end
opts.right = opts.right or {}
table.insert(opts.right, {
title = "Outline",
ft = "Outline",
pinned = true,
open = "Outline",
})
end,
},
}