Split diagnostic configuration to separate file

This commit is contained in:
Sonny Bakker 2025-04-01 22:15:23 +02:00
parent a68558e4ae
commit 87f05c5d83
4 changed files with 15 additions and 8 deletions

View file

@ -123,3 +123,6 @@
- src: 'templates/nvim/lua/formatting.lua.j2'
dest: '{{ xdg_config_dir }}/nvim/lua/formatting.lua'
- src: 'templates/nvim/lua/diagnostic.lua.j2'
dest: '{{ xdg_config_dir }}/nvim/lua/diagnostic.lua'

View file

@ -12,3 +12,4 @@ require('_nvim-tree')
require('lua-line')
require('_source-link')
require('formatting')
require('diagnostic')

View file

@ -0,0 +1,11 @@
-- {{ ansible_managed }}
vim.diagnostic.config {
float = {
suffix = function(diagnostic)
return (' %s | [%s]'):format(diagnostic.code, diagnostic.source)
end
},
virtual_text = { current_line = true }
}

View file

@ -186,11 +186,3 @@ cmp.setup {
end,
},
}
vim.diagnostic.config {
float = {
suffix = function(diagnostic)
return (' %s | [%s]'):format(diagnostic.code, diagnostic.source)
end
},
}