72
README.md
72
README.md
@@ -1,49 +1,65 @@
|
|||||||
# symbols-outline.nvim
|
# symbols-outline.nvim
|
||||||
<b> A tree like view for symbols in Neovim using the Language Server Protocol. Supports all your favourite languages.</b>
|
|
||||||
|
**A tree like view for symbols in Neovim using the Language Server Protocol.
|
||||||
|
Supports all your favourite languages.**
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- `neovim 0.5+` (nightly)
|
- `neovim 0.5+` (nightly)
|
||||||
|
|
||||||
# Installation
|
### Installation
|
||||||
|
|
||||||
using `vim-plug`
|
Using `vim-plug`
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
Plug 'simrat39/symbols-outline.nvim'
|
Plug 'simrat39/symbols-outline.nvim'
|
||||||
```
|
```
|
||||||
|
|
||||||
# Setup
|
### Configuration
|
||||||
|
|
||||||
|
Define a global variable `symbols_outline` as follows:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
local opts = {
|
-- init.lua
|
||||||
-- whether to highlight the currently hovered symbol
|
vim.g.symbols_outline = {
|
||||||
-- disable if your cpu usage is higher than you want it
|
|
||||||
-- or you just hate the highlight
|
|
||||||
-- default: true
|
|
||||||
highlight_hovered_item = true,
|
highlight_hovered_item = true,
|
||||||
|
|
||||||
-- whether to show outline guides
|
|
||||||
-- default: true
|
|
||||||
show_guides = true,
|
show_guides = true,
|
||||||
|
position = 'right',
|
||||||
}
|
}
|
||||||
|
|
||||||
require('symbols-outline').setup(opts)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Commands
|
|
||||||
```vim
|
```vim
|
||||||
SymbolsOutline
|
" init.vim
|
||||||
SymbolsOutlineOpen
|
let g:symbols_outline = {}
|
||||||
SymbolsOutlineClose
|
let g:symbols_outline.highlight_hovered_item = v:true
|
||||||
```
|
let g:symbols_outline.show_guides = v:true
|
||||||
## Keymaps
|
let g:symbols_outline.position = 'right'
|
||||||
```vim
|
|
||||||
Escape --> Close Outline
|
|
||||||
Enter --> GoTo Symbol location in code
|
|
||||||
o --> GoTo Symbol location in code but stay in outline window
|
|
||||||
Ctrl + Space --> Hover current symbol
|
|
||||||
r --> Rename symbol
|
|
||||||
a --> Code Actions
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
| Property | Description | Type | Default |
|
||||||
|
| --- | -- | -- | -- |
|
||||||
|
| highlight_hovered_item | Whether to highlight the currently hovered symbol (high cpu usage) | boolean | true |
|
||||||
|
| show_guides | Wether to show outline guides | boolean | true |
|
||||||
|
| position | Where to open the split window | 'right' or 'left' | 'right' |
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
| ---------------------- | ---------------------- |
|
||||||
|
| `:SymbolsOutline` | Toggle symbols outline |
|
||||||
|
| `:SymbolsOutlineOpen` | Open symbols outline |
|
||||||
|
| `:SymbolsOutlineClose` | Close symbols outline |
|
||||||
|
|
||||||
|
### 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 |
|
||||||
|
| r | Rename symbol |
|
||||||
|
| a | Code actions |
|
||||||
|
|
||||||
|
|||||||
11
plugin/symbols-outline.vim
Normal file
11
plugin/symbols-outline.vim
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
if exists('g:loaded_symbols_outline')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_symbols_outline = 1
|
||||||
|
|
||||||
|
if exists('g:symbols_outline')
|
||||||
|
call luaeval('require"symbols-outline".setup(_A[1])', [g:symbols_outline])
|
||||||
|
else
|
||||||
|
call luaeval('require"symbols-outline".setup()')
|
||||||
|
endif
|
||||||
|
|
||||||
Reference in New Issue
Block a user