diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 26fcb12..6095fa2 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -89,6 +89,6 @@ require('plugins.cmp') require('plugins.gitsigns') require('plugins.neogit') require('plugins.oil') +require('plugins.outline') require('plugins.telescope') require('plugins.venn') -require("outline").setup({}) diff --git a/lua/plugins/outline.lua b/lua/plugins/outline.lua new file mode 100644 index 0000000..3ea216c --- /dev/null +++ b/lua/plugins/outline.lua @@ -0,0 +1,137 @@ +require("outline").setup({ + guides = { + enabled = true, + markers = { + bottom = '└', + middle = '├', + vertical = '│', + horizontal = '─', + }, + }, + outline_items = { + show_symbol_details = true, + show_symbol_lineno = false, + -- The two below are both for auto_update_events.follow + highlight_hovered_item = true, + -- On open, always followed. This is for auto_update_events.follow, whether + -- to auto update cursor position to reflect code location. If false, can + -- manually trigger with follow_cursor (API, command, keymap action). + auto_set_cursor = true, + auto_update_events = { + follow = { 'CursorMoved' }, + items = { 'InsertLeave', 'WinEnter', 'BufEnter', 'BufWinEnter', 'BufWritePost' }, + }, + }, + outline_window = { + position = 'right', + split_command = nil, + width = 25, + relative_width = true, + wrap = false, + focus_on_open = true, + auto_close = false, + auto_jump = false, + show_numbers = false, + show_relative_numbers = false, + ---@type boolean|string? + show_cursorline = true, + hide_cursor = false, + winhl = '', + jump_highlight_duration = 400, + center_on_jump = true, + }, + preview_window = { + live = false, + auto_preview = false, + width = 50, + min_width = 50, + relative_width = true, + height = 50, + min_height = 10, + relative_height = true, + border = 'single', + open_hover_on_preview = false, + winhl = 'NormalFloat:', + winblend = 0, + }, + symbol_folding = { + autofold_depth = 1, + auto_unfold = { + hovered = true, + ---@type boolean|integer + only = true, + }, + markers = { '', '' }, + }, + keymaps = { + show_help = '?', + close = { '', 'q' }, + goto_location = '', + peek_location = 'o', + goto_and_close = '', + restore_location = '', + hover_symbol = '', + toggle_preview = 'K', + rename_symbol = 'r', + code_actions = 'a', + fold = 'h', + fold_toggle = '', + fold_toggle_all = '', + unfold = 'l', + fold_all = 'W', + unfold_all = 'E', + fold_reset = 'R', + down_and_jump = '', + up_and_jump = '', + }, + providers = { + priority = { 'lsp', 'coc', 'markdown', 'norg' }, + lsp = { + blacklist_clients = {}, + }, + markdown = { + filetypes = { 'markdown' }, + }, + }, + symbols = { + ---@type outline.FilterConfig? + filter = nil, + icon_source = nil, + icon_fetcher = nil, + icons = { + File = { icon = '', hl = 'Identifier' }, + Module = { icon = '', hl = 'Include' }, + Namespace = { icon = '{}', hl = 'Include' }, + Package = { icon = '', hl = 'Include' }, + Class = { icon = '𝓒', hl = 'Type' }, + Method = { icon = '.ƒ', hl = 'Function' }, + Property = { icon = '', hl = 'Identifier' }, + Field = { icon = '-', hl = 'Identifier' }, + Constructor = { icon = '()', hl = 'Special' }, + Enum = { icon = 'ℰ', hl = 'Type' }, + Interface = { icon = 'i', hl = 'Type' }, + Function = { icon = 'ƒ', hl = 'Function' }, + Variable = { icon = '(x)', hl = 'Constant' }, + Constant = { icon = 'c', hl = 'Constant' }, + String = { icon = '𝓐', hl = 'String' }, + Number = { icon = '#', hl = 'Number' }, + Boolean = { icon = '⊨', hl = 'Boolean' }, + Array = { icon = '[]', hl = 'Constant' }, + Object = { icon = '⦿', hl = 'Type' }, + Key = { icon = '🔐', hl = 'Type' }, + Null = { icon = 'NULL', hl = 'Type' }, + EnumMember = { icon = '', hl = 'Identifier' }, + Struct = { icon = '𝓢', hl = 'Structure' }, + Event = { icon = '🗲', hl = 'Type' }, + Operator = { icon = '+', hl = 'Identifier' }, + TypeParameter = { icon = '𝙏', hl = 'Identifier' }, + Component = { icon = '', hl = 'Function' }, + Fragment = { icon = '-', hl = 'Constant' }, + -- ccls + TypeAlias = { icon = 't ', hl = 'Type' }, + Parameter = { icon = 'p ', hl = 'Identifier' }, + StaticMethod = { icon = '. ', hl = 'Function' }, + Macro = { icon = ' ', hl = 'Function' }, + }, + }, +})