From e6f4dced5911c755ba14ec711b347b0a012ebd8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Tue, 15 Apr 2025 07:54:09 +0200 Subject: [PATCH] nvim: migrate lsp lines to builtin --- dot_config/nvim/lua/configs/options.lua | 28 ++++++++++--------- .../nvim/lua/configs/packages/colors.lua | 11 -------- dot_config/nvim/lua/configs/packages/misc.lua | 27 ++++-------------- 3 files changed, 20 insertions(+), 46 deletions(-) diff --git a/dot_config/nvim/lua/configs/options.lua b/dot_config/nvim/lua/configs/options.lua index 39355f1..e9e27d0 100644 --- a/dot_config/nvim/lua/configs/options.lua +++ b/dot_config/nvim/lua/configs/options.lua @@ -47,7 +47,7 @@ function M.setup() local isfname = {} for _, ch in ipairs(vim.opt.isfname:get()) do - if ch ~= "=" then + if ch ~= '=' then table.insert(isfname, ch) end end @@ -122,17 +122,19 @@ function M.setup() end, }) + local sev = vim.diagnostic.severity vim.diagnostic.config({ - virtual_text = false - -- virtual_text = { - -- format = function(diag) - -- local s = vim.diagnostic.severity - -- if diag.severity == s.E or diag.severity == s.W then - -- return diag.message - -- end - -- return nil - -- end, - -- }, + virtual_text = false, + virtual_lines = { current_line = true }, + + signs = { + text = { + [sev.ERROR] = '', + [sev.WARN] = '', + [sev.INFO] = '', + [sev.HINT] = '󰌵', + }, + }, }) if vim.g.neoray then -- {{{ @@ -154,7 +156,7 @@ function M.reset(winids) winids = api.nvim_tabpage_list_wins(0) end - if type(winids) == number then + if type(winids) == 'number' then winids = { winids } end @@ -165,7 +167,7 @@ function M.reset(winids) for _, win in pairs(winids) do local buf = api.nvim_win_get_buf(win) - local ft = api.nvim_get_option_value('filetype', { buf = buf}) + local ft = api.nvim_get_option_value('filetype', { buf = buf }) end end diff --git a/dot_config/nvim/lua/configs/packages/colors.lua b/dot_config/nvim/lua/configs/packages/colors.lua index 1d75444..032ebf1 100644 --- a/dot_config/nvim/lua/configs/packages/colors.lua +++ b/dot_config/nvim/lua/configs/packages/colors.lua @@ -218,17 +218,6 @@ function M.config() end, }) - vim.api.nvim_create_autocmd('ColorschemePre', { - group = augr, - pattern = '*', - callback = function() - vim.fn.sign_define('DiagnosticSignError', { text = ' ', texthl = 'DiagnosticSignError' }) - vim.fn.sign_define('DiagnosticSignWarn', { text = ' ', texthl = 'DiagnosticSignWarn' }) - vim.fn.sign_define('DiagnosticSignInfo', { text = ' ', texthl = 'DiagnosticSignInfo' }) - vim.fn.sign_define('DiagnosticSignHint', { text = '󰌵', texthl = 'DiagnosticSignHint' }) - end, - }) - local term = vim.env.TERM if (term ~= 'linux' or vim.g.neoray) then diff --git a/dot_config/nvim/lua/configs/packages/misc.lua b/dot_config/nvim/lua/configs/packages/misc.lua index 1ef7ecf..94b03b6 100644 --- a/dot_config/nvim/lua/configs/packages/misc.lua +++ b/dot_config/nvim/lua/configs/packages/misc.lua @@ -77,23 +77,6 @@ return { }, { 'dyng/ctrlsf.vim', cmd = 'CtrlSF' }, - { - 'https://git.sr.ht/~whynothugo/lsp_lines.nvim', - config = function() - local lines = require('lsp_lines') - lines.setup() - vim.diagnostic.config({ - virtual_lines = function(_, bufnr) - local ft = vim.api.nvim_get_option_value('filetype', { buf = bufnr }) - if ft == 'lazy' then - return false - else - return { only_current_line = true } - end - end, - }) - end, - }, { 'andymass/vim-matchup', @@ -103,9 +86,9 @@ return { end, }, - { 'fpob/nette.vim', ft = 'nette' }, - { 'ziglang/zig.vim', ft = 'zig' }, - { 'chrisbra/csv.vim', ft = 'csv' }, + { 'fpob/nette.vim', ft = 'nette' }, + { 'ziglang/zig.vim', ft = 'zig' }, + { 'chrisbra/csv.vim', ft = 'csv' }, { 'NoahTheDuke/vim-just' }, { 'towolf/vim-helm' }, { 'grafana/vim-alloy' }, @@ -146,7 +129,7 @@ return { { 'kristijanhusak/vim-dadbod-ui', dependencies = { - { 'tpope/vim-dadbod', lazy = true }, + { 'tpope/vim-dadbod', lazy = true }, { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, }, cmd = { @@ -159,5 +142,5 @@ return { -- Your DBUI configuration vim.g.db_ui_use_nerd_fonts = 1 end, - } + }, }