feat: enable virtual_text for diagnostic and add swap_diagnostic keymap

This commit is contained in:
Matej Janezic 2025-10-13 23:48:51 +02:00
parent e3394bb65c
commit 67b668bf60
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
1 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,15 @@ vim.o.expandtab = true
vim.o.ignorecase = true vim.o.ignorecase = true
vim.o.smartcase = true vim.o.smartcase = true
-- diagnostic show virtual text
vim.diagnostic.config({ virtual_text = true })
local function swap_diagnostic()
local virtext = vim.diagnostic.config().virtual_text
local virlines = vim.diagnostic.config().virtual_lines
vim.diagnostic.config({ virtual_text = not virtext, virtual_lines = not virlines })
end
vim.keymap.set("n", "<leader>dt", swap_diagnostic)
-- osc52 escape codes copy -- osc52 escape codes copy
local function ocs52_paste_fail() local function ocs52_paste_fail()
vim.notify("can't paste via osc52", vim.log.levels.WARN) vim.notify("can't paste via osc52", vim.log.levels.WARN)