From 93c8643fd81898fe36b59097dcaaa4cbb42d163a Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 30 Jul 2023 18:32:53 +0300 Subject: [PATCH 1/5] feat(modules/basic): make leader key configurable --- modules/basic/config.nix | 3 +++ modules/basic/module.nix | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/modules/basic/config.nix b/modules/basic/config.nix index d510505..6e4237c 100644 --- a/modules/basic/config.nix +++ b/modules/basic/config.nix @@ -142,6 +142,9 @@ in { set spell set spelllang=${toString cfg.spellChecking.language} ''} + ${optionalString (cfg.leaderKey != null) '' + let mapleader = "${toString cfg.leaderKey}" + ''} ''; }; } diff --git a/modules/basic/module.nix b/modules/basic/module.nix index ade7d10..3f8e49a 100644 --- a/modules/basic/module.nix +++ b/modules/basic/module.nix @@ -31,6 +31,12 @@ with builtins; { }; }; + leaderKey = mkOption { + type = with types; nullOr str; + default = null; + description = "The leader key to be used internally"; + }; + colourTerm = mkOption { type = types.bool; default = true; From 962029703e17cf0e31713e948c6990b46e0c81cd Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 30 Jul 2023 19:54:43 +0300 Subject: [PATCH 2/5] feat: add lsp_lines plugin source --- flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ lib/types/plugins.nix | 1 + 3 files changed, 23 insertions(+) diff --git a/flake.lock b/flake.lock index 9c14e84..078c43f 100644 --- a/flake.lock +++ b/flake.lock @@ -613,6 +613,22 @@ "type": "github" } }, + "lsp-lines": { + "flake": false, + "locked": { + "lastModified": 1684163755, + "narHash": "sha256-Zhf2xitLWtE+dWqhvWtLM1K1WdtBvkqqoRLSYIO42oY=", + "owner": "~whynothugo", + "repo": "lsp_lines.nvim", + "rev": "f53af96d4789eef39a082dbcce078d2bfc384ece", + "type": "sourcehut" + }, + "original": { + "owner": "~whynothugo", + "repo": "lsp_lines.nvim", + "type": "sourcehut" + } + }, "lsp-signature": { "flake": false, "locked": { @@ -1421,6 +1437,7 @@ "indent-blankline": "indent-blankline", "kommentary": "kommentary", "leap-nvim": "leap-nvim", + "lsp-lines": "lsp-lines", "lsp-signature": "lsp-signature", "lspkind": "lspkind", "lspsaga": "lspsaga", diff --git a/flake.nix b/flake.nix index 4a81e24..957010b 100644 --- a/flake.nix +++ b/flake.nix @@ -108,6 +108,11 @@ flake = false; }; + lsp-lines = { + url = "sourcehut:~whynothugo/lsp_lines.nvim"; + flake = false; + }; + null-ls = { url = "github:jose-elias-alvarez/null-ls.nvim"; flake = false; diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index ccbde55..18ad20c 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -90,6 +90,7 @@ with lib; let "nvim-navic" "nvim-navbuddy" "copilot-cmp" + "lsp-lines" ]; # You can either use the name of the plugin or a package. pluginType = with types; From f4c2845049e65ca5d9b88d31b6479e434de6ec56 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 30 Jul 2023 19:54:54 +0300 Subject: [PATCH 3/5] 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]"; + }; + }; +} From 6517e5b9071753863b02883dd3c938bafdafcdc4 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 30 Jul 2023 19:55:16 +0300 Subject: [PATCH 4/5] feat: enable lsplines on maximal configuration --- configuration.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configuration.nix b/configuration.nix index 5aaba59..f8fcafe 100644 --- a/configuration.nix +++ b/configuration.nix @@ -34,9 +34,10 @@ inputs: let lspkind.enable = false; lightbulb.enable = true; lspsaga.enable = false; - nvimCodeActionMenu.enable = true; + nvimCodeActionMenu.enable = isMaximal; trouble.enable = true; lspSignature.enable = true; + lsplines.enable = isMaximal; }; vim.debugger = { From f3591fb4312e3939eb59bc5b4b75866820b6618c Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 30 Jul 2023 19:58:27 +0300 Subject: [PATCH 5/5] docs: add release note entry --- docs/release-notes/rl-0.5.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release-notes/rl-0.5.adoc b/docs/release-notes/rl-0.5.adoc index ff7a105..3cef9ed 100644 --- a/docs/release-notes/rl-0.5.adoc +++ b/docs/release-notes/rl-0.5.adoc @@ -35,3 +35,5 @@ https://github.com/notashelf[notashelf]: * Addeed nvim-navic integration for catppuccin theme * Fixed mismatching zig language description + +* Added lsp_lines plugin for showing diagnostic messages