add inline error messages

This commit is contained in:
jl54 2025-03-23 21:41:45 +01:00
parent 8d3a9a1774
commit 0ace78175a
2 changed files with 30 additions and 0 deletions

View File

@ -599,6 +599,8 @@ require('lazy').setup({
}, },
} }
require('custom.diagnostics').setup()
-- Ensure the servers and tools above are installed -- Ensure the servers and tools above are installed
-- To check the current status of installed tools and/or manually install -- To check the current status of installed tools and/or manually install
-- other tools, you can run -- other tools, you can run

View File

@ -0,0 +1,28 @@
-- Custom LSP diagnostic configuration
local M = {}
M.setup = function()
vim.diagnostic.config {
virtual_text = {
prefix = '', -- Change symbol if needed
spacing = 4,
},
signs = true,
underline = true,
update_in_insert = false,
severity_sort = true,
float = {
source = 'always',
},
}
-- Show diagnostics in a floating window when hovering
vim.o.updatetime = 250
vim.api.nvim_create_autocmd('CursorHold', {
callback = function()
vim.diagnostic.open_float(nil, { focusable = false })
end,
})
end
return M