Skip to content

Commit 0ace781

Browse files
committed
add inline error messages
1 parent 8d3a9a1 commit 0ace781

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

init.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ require('lazy').setup({
599599
},
600600
}
601601

602+
require('custom.diagnostics').setup()
603+
602604
-- Ensure the servers and tools above are installed
603605
-- To check the current status of installed tools and/or manually install
604606
-- other tools, you can run

lua/custom/diagnostics.lua

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-- Custom LSP diagnostic configuration
2+
local M = {}
3+
4+
M.setup = function()
5+
vim.diagnostic.config {
6+
virtual_text = {
7+
prefix = '', -- Change symbol if needed
8+
spacing = 4,
9+
},
10+
signs = true,
11+
underline = true,
12+
update_in_insert = false,
13+
severity_sort = true,
14+
float = {
15+
source = 'always',
16+
},
17+
}
18+
19+
-- Show diagnostics in a floating window when hovering
20+
vim.o.updatetime = 250
21+
vim.api.nvim_create_autocmd('CursorHold', {
22+
callback = function()
23+
vim.diagnostic.open_float(nil, { focusable = false })
24+
end,
25+
})
26+
end
27+
28+
return M

0 commit comments

Comments
 (0)