mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
nvim: refactor diagnostic configuration
This commit is contained in:
parent
65f5e1107b
commit
2b4dca0131
1 changed files with 18 additions and 11 deletions
|
|
@ -75,6 +75,23 @@ local servers = {
|
|||
-------------
|
||||
-- Helpers --
|
||||
-------------
|
||||
vim.diagnostic.config {
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = "E",
|
||||
[vim.diagnostic.severity.WARN] = "W",
|
||||
[vim.diagnostic.severity.INFO] = "H",
|
||||
[vim.diagnostic.severity.HINT] = "·",
|
||||
},
|
||||
},
|
||||
severity_sort = true,
|
||||
underline = {
|
||||
severity = {
|
||||
vim.diagnostic.severity.ERROR,
|
||||
vim.diagnostic.severity.WARN,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Helix style border
|
||||
local border = {
|
||||
|
|
@ -94,18 +111,9 @@ function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
|||
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
||||
end
|
||||
|
||||
-- Diagnostic display configuration
|
||||
vim.diagnostic.config { virtual_text = false, severity_sort = true }
|
||||
|
||||
-- Set log level
|
||||
vim.lsp.set_log_level("off")
|
||||
|
||||
-- Gutter symbols setup
|
||||
vim.fn.sign_define("DiagnosticSignError", { text = "E", texthl = "DiagnosticSignError", numhl = "DiagnosticSignError" })
|
||||
vim.fn.sign_define("DiagnosticSignWarn", { text = "W", texthl = "DiagnosticSignWarn", numhl = "DiagnosticSignWarn" })
|
||||
vim.fn.sign_define("DiagnosticSignHint", { text = "H", texthl = "DiagnosticSignHint", numhl = "DiagnosticSignHint" })
|
||||
vim.fn.sign_define("DiagnosticSignInfo", { text = "·", texthl = "DiagnosticSignInfo", numhl = "DiagnosticSignInfo" })
|
||||
|
||||
-- Capabilities
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
|
|
@ -115,8 +123,7 @@ capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
|||
----------
|
||||
require("fidget").setup()
|
||||
|
||||
|
||||
local mylsp = require('lsp')
|
||||
local mylsp = require("lsp")
|
||||
|
||||
for name, config in pairs(servers) do
|
||||
require("lspconfig")[name].setup {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue