263 lines
9.5 KiB
Plaintext
263 lines
9.5 KiB
Plaintext
*symbols-outline.txt* Tree view of LSP symbols
|
||
|
||
================================================================================
|
||
CONTENTS *symbols-outline-contents*
|
||
|
||
1. Introduction...........................|symbols-outline-introduction|
|
||
2. Prerequisites.........................|symbols-outline-prerequisites|
|
||
3. Installation...........................|symbols-outline-installation|
|
||
4. Configuration.........................|symbols-outline-configuration|
|
||
5. Commands...................................|symbols-outline-commands|
|
||
6. Default keymaps.....................|symbols-outline-default_keymaps|
|
||
7. Highlights...............................|symbols-outline-highlights|
|
||
|
||
|
||
================================================================================
|
||
1. INTRODUCTION *symbols-outline-introduction*
|
||
|
||
A tree like view for symbols in Neovim using the Language Server Protocol.
|
||
Supports all your favourite languages.
|
||
|
||
================================================================================
|
||
2. PREREQUISITES *symbols-outline-prerequisites*
|
||
|
||
* `neovim 0.5+`
|
||
* Properly configured Neovim LSP client
|
||
|
||
|
||
================================================================================
|
||
3. INSTALLATION *symbols-outline-installation*
|
||
|
||
Using `vim-plug`
|
||
>
|
||
Plug 'simrat39/symbols-outline.nvim'
|
||
<
|
||
|
||
|
||
================================================================================
|
||
4. CONFIGURATION *symbols-outline-configuration*
|
||
|
||
Define a global variable `symbols_outline` as follows:
|
||
|
||
Only add stuff that you want to override (even in nested tables),
|
||
or skip this section entirely if you want to roll with the defaults.
|
||
>
|
||
-- init.lua
|
||
vim.g.symbols_outline = {
|
||
highlight_hovered_item = true,
|
||
show_guides = true,
|
||
auto_preview = true,
|
||
position = 'right',
|
||
width = 25,
|
||
show_numbers = false,
|
||
show_relative_numbers = false,
|
||
show_symbol_details = true,
|
||
preview_bg_highlight = 'Pmenu',
|
||
-- These keymaps can be a string or a table for multiple keys
|
||
keymaps = {
|
||
close = {"<Esc>", "q"},
|
||
goto_location = "<Cr>",
|
||
focus_location = "o",
|
||
hover_symbol = "<C-space>",
|
||
toggle_preview = "K",
|
||
rename_symbol = "r",
|
||
code_actions = "a",
|
||
},
|
||
lsp_blacklist = {},
|
||
symbol_blacklist = {},
|
||
symbols = {
|
||
File = {icon = "", hl = "TSURI"},
|
||
Module = {icon = "", hl = "TSNamespace"},
|
||
Namespace = {icon = "", hl = "TSNamespace"},
|
||
Package = {icon = "", hl = "TSNamespace"},
|
||
Class = {icon = "𝓒", hl = "TSType"},
|
||
Method = {icon = "ƒ", hl = "TSMethod"},
|
||
Property = {icon = "", hl = "TSMethod"},
|
||
Field = {icon = "", hl = "TSField"},
|
||
Constructor = {icon = "", hl = "TSConstructor"},
|
||
Enum = {icon = "ℰ", hl = "TSType"},
|
||
Interface = {icon = "ﰮ", hl = "TSType"},
|
||
Function = {icon = "", hl = "TSFunction"},
|
||
Variable = {icon = "", hl = "TSConstant"},
|
||
Constant = {icon = "", hl = "TSConstant"},
|
||
String = {icon = "𝓐", hl = "TSString"},
|
||
Number = {icon = "#", hl = "TSNumber"},
|
||
Boolean = {icon = "⊨", hl = "TSBoolean"},
|
||
Array = {icon = "", hl = "TSConstant"},
|
||
Object = {icon = "⦿", hl = "TSType"},
|
||
Key = {icon = "🔐", hl = "TSType"},
|
||
Null = {icon = "NULL", hl = "TSType"},
|
||
EnumMember = {icon = "", hl = "TSField"},
|
||
Struct = {icon = "𝓢", hl = "TSType"},
|
||
Event = {icon = "🗲", hl = "TSType"},
|
||
Operator = {icon = "+", hl = "TSOperator"},
|
||
TypeParameter = {icon = "𝙏", hl = "TSParameter"}
|
||
}
|
||
}
|
||
<
|
||
|
||
-----------------------------------------------------------------------------
|
||
highlight_hovered_item
|
||
|
||
Whether to highlight the currently hovered symbol (high cpu usage)
|
||
|
||
Default: true ~
|
||
|
||
Type: boolean
|
||
|
||
-----------------------------------------------------------------------------
|
||
show_guides
|
||
|
||
Whether to show outline guides
|
||
|
||
Default: true ~
|
||
|
||
Type: boolean
|
||
|
||
-----------------------------------------------------------------------------
|
||
position
|
||
|
||
Where to open the split window
|
||
|
||
Default: 'right' ~
|
||
|
||
Type: 'right' or 'left'
|
||
|
||
-----------------------------------------------------------------------------
|
||
width
|
||
|
||
How big the window is (relative to the current split)
|
||
|
||
Default: 25 ~
|
||
|
||
Type: int
|
||
|
||
-----------------------------------------------------------------------------
|
||
auto_preview
|
||
|
||
Show a preview of the code on hover
|
||
|
||
Default: true ~
|
||
|
||
Type: boolean
|
||
|
||
-----------------------------------------------------------------------------
|
||
show_numbers
|
||
|
||
Shows numbers with the outline
|
||
|
||
Default: false ~
|
||
|
||
Type: boolean
|
||
|
||
-----------------------------------------------------------------------------
|
||
show_relative_numbers
|
||
|
||
Shows relative numbers with the outline
|
||
|
||
Default: false ~
|
||
|
||
Type: boolean
|
||
|
||
-----------------------------------------------------------------------------
|
||
show_symbol_details
|
||
|
||
Shows extra details with the symbols (lsp dependent)
|
||
|
||
Default: true ~
|
||
|
||
Type: boolean
|
||
|
||
-----------------------------------------------------------------------------
|
||
preview_bg_highlight
|
||
|
||
Background color of the preview window
|
||
|
||
Default: Pmenu
|
||
|
||
Type: string
|
||
|
||
-----------------------------------------------------------------------------
|
||
keymaps
|
||
|
||
Which keys do what
|
||
|
||
Default: See |symbols-outline-default_keymaps| ~
|
||
|
||
Type: table (dictionary)
|
||
|
||
|
||
-----------------------------------------------------------------------------
|
||
symbols
|
||
|
||
Icon and highlight config for symbol icons
|
||
|
||
Default: See default config ~
|
||
|
||
Type: table (dictionary)
|
||
|
||
|
||
-----------------------------------------------------------------------------
|
||
lsp_blacklist
|
||
|
||
Which lsp clients to ignore
|
||
|
||
Default: {} ~
|
||
|
||
Type: table (dictionary)
|
||
|
||
-----------------------------------------------------------------------------
|
||
symbol_blacklist
|
||
|
||
Which symbols to ignore
|
||
|
||
>
|
||
-- symbols-outline.nvim/lua/symbols-outline/symbols.lua
|
||
{
|
||
"File", "Module", "Namespace", "Package", "Class", "Method", "Property",
|
||
"Field", "Constructor", "Enum", "Interface", "Function", "Variable",
|
||
"Constant", "String", "Number", "Boolean", "Array", "Object", "Key",
|
||
"Null", "EnumMember", "Struct", "Event", "Operator", "TypeParameter"
|
||
}
|
||
<
|
||
|
||
Default: {} ~
|
||
|
||
Type: table (dictionary)
|
||
|
||
================================================================================
|
||
5. COMMANDS *symbols-outline-commands*
|
||
|
||
| Command | Description |
|
||
| ---------------------- | ---------------------- |
|
||
| `:SymbolsOutline` | Toggle symbols outline |
|
||
| `:SymbolsOutlineOpen` | Open symbols outline |
|
||
| `:SymbolsOutlineClose` | Close symbols outline |
|
||
|
||
================================================================================
|
||
6. DEFAULT KEYMAPS *symbols-outline-default_keymaps*
|
||
|
||
| Key | Action |
|
||
| ---------- | ------------------------------------------------------------------ |
|
||
| Escape | Close outline |
|
||
| Enter | Go to symbol location in code |
|
||
| o | Go to symbol location in code without losing focus |
|
||
| Ctrl+Space | Hover current symbol |
|
||
| K | Toggles the current symbol preview |
|
||
| r | Rename symbol |
|
||
| a | Code actions |
|
||
| ? | Show help message |
|
||
|
||
================================================================================
|
||
7. HIGHLIGHTS *symbols-outline-highlights*
|
||
|
||
| Highlight | Purpose |
|
||
| ----------------------- | ------------------------------------------------------- |
|
||
| FocusedSymbol | Highlight of the focused symbol |
|
||
| Pmenu | Highlight of the preview popup windows |
|
||
| SymbolsOutlineConnector | Highlight of the table connectors |
|
||
| Comment | Highlight of the table connectors and info virtual text |
|
||
|
||
================================================================================
|
||
vim:tw=79:ts=8:ft=help:norl
|