[vim] Add a DiagnosticFloat autocommand that shows the diagnostic window on CursorHold

Set the hold time to 300 ms.
This commit is contained in:
Eryn Wells 2024-03-08 10:57:53 -08:00
parent 4a35b3a79d
commit 0accf738ed

View file

@ -0,0 +1,15 @@
-- Eryn Wells <eryn@erynwells.me>
vim.opt.updatetime = 300
-- Show diagnostic popup on cursor hover
local diagnostic_float_group = vim.api.nvim_create_augroup("DiagnosticFloat", { clear = true })
vim.api.nvim_create_autocmd("CursorHold", {
callback = function()
vim.diagnostic.open_float {
border = "double",
focusable = false,
}
end,
group = diagnostic_float_group,
})