Update signcolumn, show diagnostics colored line numbers, remove

diagnostics signs from column. Remove tiny inline diagnostics and
re-enable virtual text with a circle icon instead of a box icon.
from c
This commit is contained in:
Martin Larsson 2025-02-19 00:05:31 +00:00
parent aa526204b5
commit e216142783
5 changed files with 42 additions and 38 deletions

View file

@ -16,7 +16,7 @@ end
-- Load keymaps before loading any plugins -- Load keymaps before loading any plugins
require("keymaps") require("keymaps")
-- change and personalize native vim settings -- Change and personalize native vim settings
vim.opt = require("vim_opt") vim.opt = require("vim_opt")
-- Initialize Lazy package manager -- Initialize Lazy package manager
@ -40,6 +40,9 @@ require("dap/setup")
-- See ":help vim.highlight.on_yank()" -- See ":help vim.highlight.on_yank()"
setup_yank_highlight() setup_yank_highlight()
-- Change built in settings related to diagnostics
require("diagnostics")
--[[ --[[
-- Annoyances in Neovim environment: -- Annoyances in Neovim environment:
-- 1. codelldb doesn't terminate C++ program after debugging. : Don't know how to fix, have asked for help. -- 1. codelldb doesn't terminate C++ program after debugging. : Don't know how to fix, have asked for help.

37
nvim/lua/diagnostics.lua Normal file
View file

@ -0,0 +1,37 @@
local colors = require("ayu.colors")
colors.generate(true)
-- These are not apart of the Ayu color theme, however, I needed these
-- colors while still fitting in with the rest
local ayu_turquoise = "#5CCFE6"
local ayu_dark_blue = "#3A7BD5"
for _, highlight in ipairs({
{ "DiagnosticUnderlineError", { undercurl = true, sp = colors.error } },
{ "DiagnosticUnderlineWarn", { undercurl = true, sp = colors.warning } },
{ "DiagnosticUnderlineHint", { undercurl = true, sp = ayu_turquoise } },
{ "DiagnosticUnderlineInfo", { undercurl = true, sp = ayu_dark_blue } },
}) do
vim.api.nvim_set_hl(0, highlight[1], highlight[2])
end
local sev = vim.diagnostic.severity
vim.diagnostic.config({
underline = true,
virtual_text = {
prefix = "",
},
update_in_insert = true,
signs = {
text = {
[sev.ERROR] = "",
[sev.WARN] = "",
[sev.INFO] = "",
[sev.HINT] = "",
},
numhl = {
[sev.WARN] = "WarningMsg",
[sev.ERROR] = "ErrorMsg",
[sev.INFO] = "DiagnosticInfo",
[sev.HINT] = "DiagnosticHint",
},
},
})

View file

@ -58,13 +58,6 @@ end
local global_capabilities = require("blink.cmp").get_lsp_capabilities() local global_capabilities = require("blink.cmp").get_lsp_capabilities()
global_capabilities.offsetEncoding = { "utf-16" } global_capabilities.offsetEncoding = { "utf-16" }
vim.diagnostic.config({
underline = true, -- Underline diagnostic errors
virtual_text = false, -- Disable inline text messages
signs = true, -- Show icons in the sign column
update_in_insert = true, -- Update diagnostics during insert mode
})
vim.lsp.config("*", { vim.lsp.config("*", {
capabilities = global_capabilities, capabilities = global_capabilities,
handlers = { handlers = {

View file

@ -1,27 +0,0 @@
return {
"rachartier/tiny-inline-diagnostic.nvim",
event = "VeryLazy",
priority = 1000,
config = function()
require("tiny-inline-diagnostic").setup()
vim.diagnostic.config({
virtual_text = false,
})
local colors = require("ayu.colors")
colors.generate(true)
-- These are not apart of the Ayu color theme, however, I needed these
-- colors while still fitting in with the rest
local ayu_turquoise = "#5CCFE6"
local ayu_dark_blue = "#3A7BD5"
for _, highlight in ipairs({
{ "DiagnosticUnderlineError", { undercurl = true, sp = colors.error } },
{ "DiagnosticUnderlineWarn", { undercurl = true, sp = colors.warning } },
{ "DiagnosticUnderlineHint", { undercurl = true, sp = ayu_turquoise } },
{ "DiagnosticUnderlineInfo", { undercurl = true, sp = ayu_dark_blue } },
}) do
vim.api.nvim_set_hl(0, highlight[1], highlight[2])
end
end
}

View file

@ -22,7 +22,7 @@ opt.softtabstop = 4
opt.shortmess:append("sI") opt.shortmess:append("sI")
-- Signcolumn -- Signcolumn
opt.signcolumn = "yes:2" -- Adds a spacing to the left which can contain gutter icons opt.signcolumn = "yes:1" -- Adds a spacing to the left which can contain gutter icons
opt.fillchars = { eob = " " } -- Remove the fill character for empty lines which defaults to: "~" opt.fillchars = { eob = " " } -- Remove the fill character for empty lines which defaults to: "~"
-- Search -- Search
@ -66,8 +66,6 @@ opt.termsync = true
opt.scrolloff = 4 opt.scrolloff = 4
-- Whitespaces -- Whitespaces
-- opt.listchars = { tab = "→\"", trail = "·", nbsp = "␣" }
-- opt.list = true
opt.list = false opt.list = false
return opt return opt