diff --git a/after/plugin/diagnostics.lua b/after/plugin/diagnostics.lua new file mode 100644 index 0000000..072210f --- /dev/null +++ b/after/plugin/diagnostics.lua @@ -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 +} +)