add configuration for diagnostic
This commit is contained in:
@@ -38,6 +38,7 @@ vim.loader.enable()
|
|||||||
-- load configuration
|
-- load configuration
|
||||||
require("config.ui")
|
require("config.ui")
|
||||||
require("config.options")
|
require("config.options")
|
||||||
|
require("config.diagnostic")
|
||||||
require("config.treesitter")
|
require("config.treesitter")
|
||||||
require("config.autocommands")
|
require("config.autocommands")
|
||||||
require("config.keymaps")
|
require("config.keymaps")
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
|
||||||
|
--[[
|
||||||
|
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣷⣦⣄⡀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠚⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠗⢀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣄⡉⠓⠦⣌⡙⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⢋⣡⠴⠚⢉⣠⣤⣀
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⣶⣿⣿⣿⣿⣿⣷⣦⣄⡉⠓⠦⣌⡙⠻⢿⣿⣿⣿⣿⣿⣿⡿⠟⢋⣡⠴⠚⢉⣠⣴⣾⣿⣿⣿⣿⣿⣶⣤
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠐⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠓⠦⣌⡙⠻⠟⢋⣡⠴⠚⢉⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⠂
|
||||||
|
⠀⠀⠀⠀⢀⣠⣴⣆⡈⠻⢿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠃⠘⢉⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢁⣰⣦⣄⡀
|
||||||
|
⠀⠀⠐⠾⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠷⠂
|
||||||
|
⠀⢸⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⡇
|
||||||
|
⠀⢸⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⣦⣄⡉⠛⠿⠿⠛⢉⣠⣴⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⡇
|
||||||
|
⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠻⢿⣿⣷⡆⢰⣾⣿⡿⠟⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||||
|
⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣌⡙⠃⠘⢋⣡⣴⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⠛⠿⣿⣿⣿⣿⠿⠛⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⣿⣷⣦⣄⡉⢉⣠⣴⣾⣿⣿⣿⣿⣿⠿⠛⠉
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⣿⣿⣿⣿⡇⢸⣿⣿⣿⣿⠿⠛⠉
|
||||||
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠿⡇⢸⠿⠛⠉
|
||||||
|
|
||||||
|
__ _ _
|
||||||
|
/ _|___ ___| |_ __ _ ___| | __
|
||||||
|
| ||_ /____/ __| __/ _` |/ __| |/ /
|
||||||
|
| _/ /_____\__ \ || (_| | (__| <
|
||||||
|
|_|/___| |___/\__\__,_|\___|_|\_\
|
||||||
|
|
||||||
|
Neovim 0.12 configuration
|
||||||
|
(c) Frank Zechert 2026
|
||||||
|
]]
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
update_in_insert = false,
|
||||||
|
severity_sort = true,
|
||||||
|
float = {
|
||||||
|
border = vim.g.ui.border,
|
||||||
|
source = true,
|
||||||
|
},
|
||||||
|
underline = true,
|
||||||
|
-- underline = { severity = { min = vim.diagnostic.severity.WARN } },
|
||||||
|
virtual_text = {
|
||||||
|
prefix = vim.g.ui.symbols.diagnostic.virtual_text_prefix,
|
||||||
|
severity = nil, -- show all severity
|
||||||
|
spacing = 2, -- extra spacing between text and code
|
||||||
|
virt_text_pos = "eol",
|
||||||
|
source = "if_many",
|
||||||
|
format = function(diagnostic) -- Customize the text shown in virtual text
|
||||||
|
local severity = vim.diagnostic.severity[diagnostic.severity]
|
||||||
|
local symbols = {
|
||||||
|
ERROR = vim.g.ui.symbols.diagnostic.sign_error,
|
||||||
|
WARN = vim.g.ui.symbols.diagnostic.sign_warn,
|
||||||
|
INFO = vim.g.ui.symbols.diagnostic.sign_info,
|
||||||
|
HINT = vim.g.ui.symbols.diagnostic.sign_hint,
|
||||||
|
}
|
||||||
|
return string.format("%s", diagnostic.message)
|
||||||
|
end,
|
||||||
|
|
||||||
|
},
|
||||||
|
virtual_lines = false,
|
||||||
|
jump = {
|
||||||
|
on_jump = function(_, bufnr)
|
||||||
|
vim.diagnostic.open_float({
|
||||||
|
bufnr = bufnr,
|
||||||
|
scope = 'cursor',
|
||||||
|
focus = false
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
signs = {
|
||||||
|
-- icons in sign column
|
||||||
|
text = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = vim.g.ui.symbols.diagnostic.sign_error,
|
||||||
|
[vim.diagnostic.severity.WARN] = vim.g.ui.symbols.diagnostic.sign_warn,
|
||||||
|
[vim.diagnostic.severity.INFO] = vim.g.ui.symbols.diagnostic.sign_info,
|
||||||
|
[vim.diagnostic.severity.HINT] = vim.g.ui.symbols.diagnostic.sign_hint,
|
||||||
|
},
|
||||||
|
-- highlight line
|
||||||
|
linehl = {
|
||||||
|
-- [vim.diagnostic.severity.ERROR] = "ErrorMsg",
|
||||||
|
},
|
||||||
|
-- diagnostic sign priority
|
||||||
|
priority = 20,
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open Diagnostic Quickfix List" })
|
||||||
@@ -64,6 +64,13 @@ vim.g.ui = {
|
|||||||
component_separators = { left = "│", right = "│" },
|
component_separators = { left = "│", right = "│" },
|
||||||
section_separators = { left = "▒", right = "▒" },
|
section_separators = { left = "▒", right = "▒" },
|
||||||
window = "",
|
window = "",
|
||||||
|
diagnostic = {
|
||||||
|
prefix = "■",
|
||||||
|
sign_error = "E",
|
||||||
|
sign_warn = "W",
|
||||||
|
sign_info = "I",
|
||||||
|
sign_hint = "H",
|
||||||
|
},
|
||||||
git = {
|
git = {
|
||||||
signs = {
|
signs = {
|
||||||
add = { text = "┃" },
|
add = { text = "┃" },
|
||||||
|
|||||||
Reference in New Issue
Block a user