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

@ -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>", "<<")