add possibility to globally disable lsp virtual text

This commit is contained in:
Maciej Lebiest 2023-05-14 12:39:06 +02:00
parent 5cefd8c21e
commit c1a3e10946
2 changed files with 12 additions and 17 deletions

View file

@ -183,22 +183,6 @@ All that is saved in image, so that is why image is so heavy.
### Commands and keys
#### root perms when editing
```bash
# Re-open a current file with sudo
:SudaRead
# Open /etc/sudoers with sudo
:SudaRead /etc/sudoers
```
```bash
# Forcedly save a current file with sudo
:SudaWrite
# Write contents to /etc/profile
:SudaWrite /etc/profile
```
#### General
|keys|action|
@ -335,10 +319,11 @@ GitSings provides some commands for displaying git stuff:
|\<leader\>wr |remove workspace folder|
|\<leader\>wl | list workspace folders |
#### LSP diagnostics (trouble.nvim)
#### LSP diagnostics (custom and trouble.nvim)
|||
|----|----|
|\<leader\>vt| switch display of virtual text|
|\<leader\>xx| Open diagnostics window|
|\<leader\>xw |workspace diagnostics|
|\<leader\>xd |document diagnostics|

View file

@ -19,6 +19,16 @@ end
-- open nvim tree on start
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
-- disabling virtual text
VIRTUAL_TEXT_ENABLED = true
function switch_virtual_text()
VIRTUAL_TEXT_ENABLED = not VIRTUAL_TEXT_ENABLED
vim.diagnostic.config({
virtual_text = VIRTUAL_TEXT_ENABLED,
})
end
map("n", "<leader>vt", ":lua switch_virtual_text()<CR>")
-- tab lines in normal and visual mode
map("n", "<Tab>", ">>")
map("n", "<S-Tab>", "<<")