vim/diagnostics: add central coniguration

This commit is contained in:
Fernando Schauenburg 2023-08-08 04:18:14 +02:00
parent 9906368e50
commit 8519e22d00
3 changed files with 28 additions and 4 deletions

View file

@ -0,0 +1,23 @@
vim.diagnostic.config {
underline = false,
virtual_text = {
spacing = 6,
prefix = '',
},
float = {
border = 'rounded',
},
severity_sort = true,
}
local signs = {
Error = '',
Warn = '',
Info = '',
Hint = '',
}
for type, icon in pairs(signs) do
local hl = 'DiagnosticSign' .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end

View file

@ -7,5 +7,6 @@ require 'fschauen.options'
require 'fschauen.keymap'
require 'fschauen.autocmds'
require 'fschauen.filetypes'
require 'fschauen.diagnostics'
require 'fschauen.lazy'

View file

@ -79,9 +79,9 @@ end
local diag_opts = {
wrap = false, -- don't wrap around the begin/end of file
float = {
border = 'rounded' -- enable border for the floating window
},
-- float = {
-- border = 'rounded' -- enable border for the floating window
-- },
}
--- Move to the next diagnostic.
@ -99,7 +99,7 @@ M.goto_prev_diagnostic = function(opts)
end
M.open_float_diagnostic = function(opts)
vim.diagnostic.open_float(vim.tbl_extend('keep', opts or {}, { border = 'rounded' }))
vim.diagnostic.open_float(opts)
end
M.toggle_diagnostics = function(bufnr)