From ff8bdc0eb8fef3eabf2a6e337f43d88edda14db9 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Fri, 11 Oct 2024 12:51:01 -0700 Subject: [PATCH] feat: use lsp_lines --- flake.nix | 1 + lua/lsp/init.lua | 7 +++++++ lua/plugins/lz-spec.lua | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/flake.nix b/flake.nix index baf7062..a92aaa3 100644 --- a/flake.nix +++ b/flake.nix @@ -171,6 +171,7 @@ crates-nvim haskell-tools-nvim vim-wakatime + lsp_lines-nvim ]; }; diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index bd14ed0..e1fdfee 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -1,4 +1,11 @@ return function() + local symbols = { Error = "󰅙", Info = "󰋼", Hint = "󰌵", Warn = "" } + + for name, icon in pairs(symbols) do + local hl = "DiagnosticSign" .. name + vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl }) + end + local lspconfig = require("lspconfig") lspconfig.lua_ls.setup({ diff --git a/lua/plugins/lz-spec.lua b/lua/plugins/lz-spec.lua index b366556..5f8019f 100644 --- a/lua/plugins/lz-spec.lua +++ b/lua/plugins/lz-spec.lua @@ -237,4 +237,15 @@ return { }, { "rustaceanvim" }, { "haskell-tools.nvim" }, + { + "lsp_lines.nvim", + event = "LspAttach", + after = function() + require("lsp_lines").setup() + vim.diagnostic.config({ + virtual_text = false, + virtual_lines = { only_current_line = true }, + }) + end, + }, }