Home

Awesome

[!NOTE] Due to lack of time, this plugin has been archived.

symbols-outline.nvim

A tree like view for symbols in Neovim using the Language Server Protocol. Supports all your favourite languages.

demo

Prerequisites

Installation

Using packer.nvim

use 'simrat39/symbols-outline.nvim'

Setup

Put the setup call in your init.lua or any lua file that is sourced.

require("symbols-outline").setup()

Configuration

Pass a table to the setup call above with your configuration options.

local opts = {
  highlight_hovered_item = true,
  show_guides = true,
  auto_preview = false,
  position = 'right',
  relative_width = true,
  width = 25,
  auto_close = false,
  show_numbers = false,
  show_relative_numbers = false,
  show_symbol_details = true,
  preview_bg_highlight = 'Pmenu',
  autofold_depth = nil,
  auto_unfold_hover = true,
  fold_markers = { '', '' },
  wrap = false,
  keymaps = { -- These keymaps can be a string or a table for multiple keys
    close = {"<Esc>", "q"},
    goto_location = "<Cr>",
    focus_location = "o",
    hover_symbol = "<C-space>",
    toggle_preview = "K",
    rename_symbol = "r",
    code_actions = "a",
    fold = "h",
    unfold = "l",
    fold_all = "W",
    unfold_all = "E",
    fold_reset = "R",
  },
  lsp_blacklist = {},
  symbol_blacklist = {},
  symbols = {
    File = { icon = "", hl = "@text.uri" },
    Module = { icon = "", hl = "@namespace" },
    Namespace = { icon = "", hl = "@namespace" },
    Package = { icon = "", hl = "@namespace" },
    Class = { icon = "𝓒", hl = "@type" },
    Method = { icon = "ƒ", hl = "@method" },
    Property = { icon = "", hl = "@method" },
    Field = { icon = "", hl = "@field" },
    Constructor = { icon = "", hl = "@constructor" },
    Enum = { icon = "ℰ", hl = "@type" },
    Interface = { icon = "ﰮ", hl = "@type" },
    Function = { icon = "", hl = "@function" },
    Variable = { icon = "", hl = "@constant" },
    Constant = { icon = "", 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 = "@field" },
    Struct = { icon = "𝓢", hl = "@type" },
    Event = { icon = "🗲", hl = "@type" },
    Operator = { icon = "+", hl = "@operator" },
    TypeParameter = { icon = "𝙏", hl = "@parameter" },
    Component = { icon = "", hl = "@function" },
    Fragment = { icon = "", hl = "@constant" },
  },
}
PropertyDescriptionTypeDefault
highlight_hovered_itemWhether to highlight the currently hovered symbol (high cpu usage)booleantrue
show_guidesWhether to show outline guidesbooleantrue
positionWhere to open the split window'right' or 'left''right'
relative_widthWhether width of window is set relative to existing windowsbooleantrue
widthWidth of window (as a % or columns based on relative_width)int25
auto_closeWhether to automatically close the window after selectionbooleanfalse
auto_previewShow a preview of the code on hoverbooleanfalse
show_numbersShows numbers with the outlinebooleanfalse
show_relative_numbersShows relative numbers with the outlinebooleanfalse
show_symbol_detailsShows extra details with the symbols (lsp dependent)booleantrue
preview_bg_highlightBackground color of the preview windowstringPmenu
winblendPseudo-transparency of the preview windowint0
keymapsWhich keys do whattable (dictionary)here
symbolsIcon and highlight config for symbol iconstable (dictionary)scroll up
lsp_blacklistWhich lsp clients to ignoretable (array){}
symbol_blacklistWhich symbols to ignore (possible values)table (array){}
autofold_depthDepth past which nodes will be folded by defaultintnil
auto_unfold_hoverAutomatically unfold hovered symbolbooleantrue
fold_markersMarkers to denote foldable symbol's statustable (array){ '', '' }
wrapWhether to wrap long lines, or let them flow off the windowbooleanfalse

Commands

CommandDescription
:SymbolsOutlineToggle symbols outline
:SymbolsOutlineOpenOpen symbols outline
:SymbolsOutlineCloseClose symbols outline

Default keymaps

KeyAction
EscapeClose outline
EnterGo to symbol location in code
oGo to symbol location in code without losing focus
Ctrl+SpaceHover current symbol
KToggles the current symbol preview
rRename symbol
aCode actions
hfold symbol
lUnfold symbol
WFold all symbols
EUnfold all symbols
RReset all folding
?Show help message

Highlights

HighlightPurpose
FocusedSymbolHighlight of the focused symbol
PmenuHighlight of the preview popup windows
SymbolsOutlineConnectorHighlight of the table connectors
CommentHighlight of the info virtual text