feat(config): full vim.diagnostic config settings
This commit is contained in:
parent
9ed1d49ae5
commit
8064cf355a
3 changed files with 21 additions and 16 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
local config = {}
|
local config = {}
|
||||||
|
|
||||||
|
-- statusline settings
|
||||||
config.statusline = {
|
config.statusline = {
|
||||||
main_icon = '★',
|
main_icon = '★',
|
||||||
}
|
}
|
||||||
|
@ -29,12 +30,13 @@ config.lsp = {
|
||||||
-- set to false to disable rename notification
|
-- set to false to disable rename notification
|
||||||
rename_notification = false,
|
rename_notification = false,
|
||||||
|
|
||||||
|
-- see :h vim.diagnostic.config for all diagnostic configuration options
|
||||||
diagnostic = {
|
diagnostic = {
|
||||||
|
|
||||||
-- disable diagnostic virtual text (see :h vim.diagnostic.config for all options)
|
-- disable diagnostic virtual text
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
|
|
||||||
-- disable diagnostic signs (see :h vim.diagnostic.config for all options)
|
-- disable diagnostic signs
|
||||||
signs = false,
|
signs = false,
|
||||||
|
|
||||||
-- enable diagnostic update on insert
|
-- enable diagnostic update on insert
|
||||||
|
@ -70,6 +72,7 @@ config.lsp = {
|
||||||
-- specifc to efm, e.g. 'eslint', 'prettier', 'stylua'
|
-- specifc to efm, e.g. 'eslint', 'prettier', 'stylua'
|
||||||
disable_formatters = {'eslint'},
|
disable_formatters = {'eslint'},
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,17 @@ local default_config = {
|
||||||
lsp = {
|
lsp = {
|
||||||
format_on_save = true, -- true/false or table of filetypes {'.ts', '.js',}
|
format_on_save = true, -- true/false or table of filetypes {'.ts', '.js',}
|
||||||
rename_notification = true,
|
rename_notification = true,
|
||||||
|
-- vim.diagnostic.config settiings
|
||||||
diagnostic = {
|
diagnostic = {
|
||||||
|
underline = true,
|
||||||
signs = true,
|
signs = true,
|
||||||
update_in_insert = false,
|
update_in_insert = false,
|
||||||
|
severity_sort = true,
|
||||||
|
float = {
|
||||||
|
show_header = false,
|
||||||
|
source = 'always',
|
||||||
|
border = 'single',
|
||||||
|
},
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
spacing = 4,
|
spacing = 4,
|
||||||
source = 'always',
|
source = 'always',
|
||||||
|
@ -49,10 +57,15 @@ local default_config = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
servers = {
|
servers = {
|
||||||
|
-- override lsp server options
|
||||||
|
--[[ rust_analyzer = {
|
||||||
|
opts = {}
|
||||||
|
}, ]]
|
||||||
|
-- enable/disable server + formatting
|
||||||
|
-- rust_analyzer = true, -- enable non-default servers (todo: support for custom server configs)
|
||||||
eslint = {
|
eslint = {
|
||||||
format = false,
|
format = false,
|
||||||
}, -- enable/disable server + formatting
|
},
|
||||||
-- rust_analyzer = true, -- enable non-default servers (todo: support for custom server configs)
|
|
||||||
efm = {
|
efm = {
|
||||||
format = true, -- true or false
|
format = true, -- true or false
|
||||||
disable_formatters = { 'eslint' }, -- e.g. 'eslint', 'prettier', 'stylua'
|
disable_formatters = { 'eslint' }, -- e.g. 'eslint', 'prettier', 'stylua'
|
||||||
|
|
|
@ -3,18 +3,7 @@ local icons = require('cosmic.core.theme.icons')
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.init()
|
function M.init()
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config(config.lsp.diagnostic)
|
||||||
underline = true,
|
|
||||||
update_in_insert = config.lsp.diagnostic.update_in_insert,
|
|
||||||
virtual_text = config.lsp.diagnostic.virtual_text,
|
|
||||||
signs = config.lsp.diagnostic.signs,
|
|
||||||
severity_sort = true,
|
|
||||||
float = {
|
|
||||||
show_header = false,
|
|
||||||
source = 'always',
|
|
||||||
border = 'single',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local function do_diagnostic_signs()
|
local function do_diagnostic_signs()
|
||||||
local signs = {
|
local signs = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue