vim/diagnostics: add central coniguration
This commit is contained in:
parent
9906368e50
commit
8519e22d00
3 changed files with 28 additions and 4 deletions
23
config/nvim/lua/fschauen/diagnostics.lua
Normal file
23
config/nvim/lua/fschauen/diagnostics.lua
Normal 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
|
|
@ -7,5 +7,6 @@ require 'fschauen.options'
|
||||||
require 'fschauen.keymap'
|
require 'fschauen.keymap'
|
||||||
require 'fschauen.autocmds'
|
require 'fschauen.autocmds'
|
||||||
require 'fschauen.filetypes'
|
require 'fschauen.filetypes'
|
||||||
|
require 'fschauen.diagnostics'
|
||||||
require 'fschauen.lazy'
|
require 'fschauen.lazy'
|
||||||
|
|
||||||
|
|
|
@ -79,9 +79,9 @@ end
|
||||||
|
|
||||||
local diag_opts = {
|
local diag_opts = {
|
||||||
wrap = false, -- don't wrap around the begin/end of file
|
wrap = false, -- don't wrap around the begin/end of file
|
||||||
float = {
|
-- float = {
|
||||||
border = 'rounded' -- enable border for the floating window
|
-- border = 'rounded' -- enable border for the floating window
|
||||||
},
|
-- },
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Move to the next diagnostic.
|
--- Move to the next diagnostic.
|
||||||
|
@ -99,7 +99,7 @@ M.goto_prev_diagnostic = function(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.open_float_diagnostic = function(opts)
|
M.open_float_diagnostic = function(opts)
|
||||||
vim.diagnostic.open_float(vim.tbl_extend('keep', opts or {}, { border = 'rounded' }))
|
vim.diagnostic.open_float(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.toggle_diagnostics = function(bufnr)
|
M.toggle_diagnostics = function(bufnr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue