feat: Add option to blacklist symbols

Closes #38
This commit is contained in:
simrat39
2021-07-21 12:59:44 -07:00
parent 0868b5f463
commit 6a51c637dd
3 changed files with 65 additions and 82 deletions

View File

@@ -44,6 +44,7 @@ vim.g.symbols_outline = {
code_actions = "a",
},
lsp_blacklist = {},
symbol_blacklist = {},
symbols = {
File = {icon = "", hl = "TSURI"},
Module = {icon = "", hl = "TSNamespace"},
@@ -74,42 +75,20 @@ vim.g.symbols_outline = {
}
}
```
or
```vim
" init.vim
let g:symbols_outline = {
\ "highlight_hovered_item": v:true,
\ "show_guides": v:true,
\ "position": 'right',
\ "auto_preview": v:true,
\ "show_numbers": v:false,
\ "show_relative_numbers": v:false,
\ "show_symbol_details": v:true,
\ "keymaps": {
\ "close": "<Esc>",
\ "goto_location": "<Cr>",
\ "focus_location": "o",
\ "hover_symbol": "<C-space>",
\ "rename_symbol": "r",
\ "code_actions": "a",
\ },
\ "lsp_blacklist": [],
\ }
```
| 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' |
| auto_preview | Show a preview of the code on hover | boolean | true |
| show_numbers | Shows numbers with the outline | boolean | false |
| show_relative_numbers | Shows relative numbers with the outline | boolean | false |
| show_symbol_details | Shows extra details with the symbols (lsp dependent) | boolean | true |
| keymaps | Which keys do what | table (dictionary) | [here](#default-keymaps) |
| symbols | Icon and highlight config for symbol icons | table (dictionary) | scroll up |
| lsp_blacklist | Which lsp clients to ignore | table (array) | {} |
| 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' |
| auto_preview | Show a preview of the code on hover | boolean | true |
| show_numbers | Shows numbers with the outline | boolean | false |
| show_relative_numbers | Shows relative numbers with the outline | boolean | false |
| show_symbol_details | Shows extra details with the symbols (lsp dependent) | boolean | true |
| keymaps | Which keys do what | table (dictionary) | [here](#default-keymaps) |
| symbols | Icon and highlight config for symbol icons | table (dictionary) | scroll up |
| lsp_blacklist | Which lsp clients to ignore | table (array) | {} |
| symbol_blacklist | Which symbols to ignore ([possible values](./lua/symbols-outline/symbols.lua)) | table (array) | {} |
### Commands