From 01adfc34b7fb26d69aa0f542ced53e1e60b19501 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Tue, 5 Aug 2025 23:55:09 +0500 Subject: [PATCH] disable diagnostic inline text by default to reduce distraction --- .../nvim/lua/user/plugins/lsp/diagnostics_config.lua | 4 ++-- .config/nvim/lua/user/plugins/lsp/init.lua | 12 ++++++++++++ .config/nvim/lua/user/plugins/which_key.lua | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/user/plugins/lsp/diagnostics_config.lua b/.config/nvim/lua/user/plugins/lsp/diagnostics_config.lua index 93e22e9..d235841 100644 --- a/.config/nvim/lua/user/plugins/lsp/diagnostics_config.lua +++ b/.config/nvim/lua/user/plugins/lsp/diagnostics_config.lua @@ -2,7 +2,7 @@ local M = {} M.setup = function() local config = { - virtual_text = true, + virtual_text = false, signs = { text = { [vim.diagnostic.severity.ERROR] = '', @@ -12,7 +12,7 @@ M.setup = function() } }, update_in_insert = true, - underline = true, + underline = false, severity_sort = true, float = { focusable = true, diff --git a/.config/nvim/lua/user/plugins/lsp/init.lua b/.config/nvim/lua/user/plugins/lsp/init.lua index b82027c..1cbfd5d 100644 --- a/.config/nvim/lua/user/plugins/lsp/init.lua +++ b/.config/nvim/lua/user/plugins/lsp/init.lua @@ -19,6 +19,18 @@ return { require("user.plugins.lsp.diagnostics_config").setup() -- require("user.lsp.none_ls") + local which_key = require("which-key") + which_key.add({ + { + "ch", + function() + local current = vim.diagnostic.config().virtual_text + vim.diagnostic.config({ virtual_text = not current }) + end, + desc = "toggle inline diagnostics" + }, + }) + vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format{async=true}' ]]) end, }, diff --git a/.config/nvim/lua/user/plugins/which_key.lua b/.config/nvim/lua/user/plugins/which_key.lua index b98cf2e..074f204 100644 --- a/.config/nvim/lua/user/plugins/which_key.lua +++ b/.config/nvim/lua/user/plugins/which_key.lua @@ -99,7 +99,7 @@ return { }) which_key.add({ - { "l", "lua vim.diagnostic.setloclist()", desc = "Show diagnostic list" }, + { "cd", "lua vim.diagnostic.setloclist()", desc = "Show diagnostic list" }, }) which_key.add({