From f4c2845049e65ca5d9b88d31b6479e434de6ec56 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 30 Jul 2023 19:54:54 +0300 Subject: [PATCH] feat: lsplines module --- modules/lsp/default.nix | 1 + modules/lsp/lsplines/config.nix | 20 ++++++++++++++++++++ modules/lsp/lsplines/default.nix | 6 ++++++ modules/lsp/lsplines/lsplines.nix | 9 +++++++++ 4 files changed, 36 insertions(+) create mode 100644 modules/lsp/lsplines/config.nix create mode 100644 modules/lsp/lsplines/default.nix create mode 100644 modules/lsp/lsplines/lsplines.nix diff --git a/modules/lsp/default.nix b/modules/lsp/default.nix index 7f13e40..e39e33a 100644 --- a/modules/lsp/default.nix +++ b/modules/lsp/default.nix @@ -15,5 +15,6 @@ _: { ./lsp-signature ./lightbulb ./lspkind + ./lsplines ]; } diff --git a/modules/lsp/lsplines/config.nix b/modules/lsp/lsplines/config.nix new file mode 100644 index 0000000..8fe46d3 --- /dev/null +++ b/modules/lsp/lsplines/config.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + ... +}: +with lib; +with builtins; let + cfg = config.vim.lsp; +in { + config = mkIf (cfg.enable && cfg.lsplines.enable) { + vim.startPlugins = ["lsp-lines"]; + vim.luaConfigRC.lsplines = nvim.dag.entryAfter ["lspconfig"] '' + require("lsp_lines").setup() + + vim.diagnostic.config({ + virtual_text = false, + }) + ''; + }; +} diff --git a/modules/lsp/lsplines/default.nix b/modules/lsp/lsplines/default.nix new file mode 100644 index 0000000..fa50897 --- /dev/null +++ b/modules/lsp/lsplines/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./config.nix + ./lsplines.nix + ]; +} diff --git a/modules/lsp/lsplines/lsplines.nix b/modules/lsp/lsplines/lsplines.nix new file mode 100644 index 0000000..2b3eec4 --- /dev/null +++ b/modules/lsp/lsplines/lsplines.nix @@ -0,0 +1,9 @@ +{lib, ...}: +with lib; +with builtins; { + options.vim.lsp = { + lsplines = { + enable = mkEnableOption "diagnostics using virtual lines on top of the real line of code. [lsp_lines]"; + }; + }; +}