From 8d06275e203a11bbd79b2b8474de24edd289bcbc Mon Sep 17 00:00:00 2001 From: Brahmajit Das Date: Sat, 18 May 2024 03:31:05 +0530 Subject: nvim: plugins: lsp: removing deprecated sign_define Signed-off-by: Brahmajit Das --- lua/plugins/lsp.lua | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index bb2ae60..82244d1 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -68,10 +68,29 @@ vim.api.nvim_create_autocmd('LspAttach', { local signs = { Error = "󰅚 ", Warn = " ", Hint = " ", Info = " " } -for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) -end +vim.diagnostic.config({ + signs = { + enable = true, + text = { + ["ERROR"] = signs.Error, + ["WARN"] = signs.Warn, + ["HINT"] = signs.Hint, + ["INFO"] = signs.Info, + }, + texthl = { + ["ERROR"] = "DiagnosticDefault", + ["WARN"] = "DiagnosticDefault", + ["HINT"] = "DiagnosticDefault", + ["INFO"] = "DiagnosticDefault", + }, + numhl = { + ["ERROR"] = "DiagnosticDefault", + ["WARN"] = "DiagnosticDefault", + ["HINT"] = "DiagnosticDefault", + ["INFO"] = "DiagnosticDefault", + }, + } +}) vim.o.updatetime = 250 -- vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})]] -- cgit v1.2.3