27 lines
803 B
Lua
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
|
|
}
|
|
)
|