Configure diagnostics
Set up diagnostics
This commit is contained in:
parent
e3493b19c3
commit
3fa871ff34
26
after/plugin/diagnostics.lua
Normal file
26
after/plugin/diagnostics.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
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
|
||||||
|
}
|
||||||
|
)
|
||||||
Loading…
Reference in New Issue
Block a user