nvimconfig/after/plugin/diagnostics.lua
Robert Morrison 3fa871ff34
Configure diagnostics
Set up diagnostics
2022-07-25 20:33:31 +01:00

27 lines
803 B
Lua

vim.diagnostic.config({
virtual_text = true,
signs = true,
underline = true,
update_in_insert = true,
severity_sort = false
}
)
-- This makes the Diagnostic Sigms look prettier
local signs = { Error = "", Warn = "", Hint = "", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
-- This autocommand causes diagnostic info to appear where the cursor is hovering.
-- This is exceptionally useful when you have multiple issues per line
local gr = vim.api.nvim_create_augroup("Diagnostic_hover",{clear = true})
vim.api.nvim_create_autocmd("CursorHold",{
pattern = {"*"},
callback = function ()
vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})
end,
group = gr
}
)