From 259b3d65b8cfa9eeabd46edea835b63adba12839 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Jul 2026 00:10:59 +0000 Subject: [PATCH 1/8] fix: use valid Nix comment syntax in modules --- modules/module/settings/cat-packages.nix | 8 ++++---- modules/module/specs/plugins.nix | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/module/settings/cat-packages.nix b/modules/module/settings/cat-packages.nix index 49a33e6..fdc7145 100644 --- a/modules/module/settings/cat-packages.nix +++ b/modules/module/settings/cat-packages.nix @@ -5,10 +5,10 @@ ... }: let - -- Include packages from a category only if that category is enabled. - -- NOTE: The package list expression is still evaluated (packages in Nix are - -- lazy by default, so derivations are not built), so keep side-effecting - -- expressions out of these lists. + # Include packages from a category only if that category is enabled. + # NOTE: The package list expression is still evaluated (packages in Nix are + # lazy by default, so derivations are not built), so keep side-effecting + # expressions out of these lists. maybe = cat: pkgsList: lib.optionals (config.cats.${cat} or false) pkgsList; rPackages = (pkgs.baseRPackages or [ ]) ++ config.settings.lang_packages.r; diff --git a/modules/module/specs/plugins.nix b/modules/module/specs/plugins.nix index ff072cc..ffd7cff 100644 --- a/modules/module/specs/plugins.nix +++ b/modules/module/specs/plugins.nix @@ -190,9 +190,9 @@ in { ]; }; - -- Lazy-loaded plugins needed when the `r` cat is on. Kept separate from - -- `utils-lazy` so users with `r=true` and `utils=false` still get the - -- R debugger (via vscDebugger) and in-buffer image rendering for plots. + # Lazy-loaded plugins needed when the `r` cat is on. Kept separate from + # `utils-lazy` so users with `r=true` and `utils=false` still get the + # R debugger (via vscDebugger) and in-buffer image rendering for plots. config.specs.r-lazy = lib.mkIf (config.cats.r or false) { lazy = true; data = with pkgs.vimPlugins; [ From f4b960c6040ace861d44509fa7cb0f556bb175e6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Jul 2026 00:11:43 +0000 Subject: [PATCH 2/8] docs: clarify Nix laziness comment --- modules/module/settings/cat-packages.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/module/settings/cat-packages.nix b/modules/module/settings/cat-packages.nix index fdc7145..e68ff93 100644 --- a/modules/module/settings/cat-packages.nix +++ b/modules/module/settings/cat-packages.nix @@ -6,9 +6,9 @@ }: let # Include packages from a category only if that category is enabled. - # NOTE: The package list expression is still evaluated (packages in Nix are - # lazy by default, so derivations are not built), so keep side-effecting - # expressions out of these lists. + # NOTE: Package list expressions are lazily evaluated, and derivations are + # not built until needed, so keep side-effecting expressions out of these + # lists. maybe = cat: pkgsList: lib.optionals (config.cats.${cat} or false) pkgsList; rPackages = (pkgs.baseRPackages or [ ]) ++ config.settings.lang_packages.r; From d45d85e5bca53910f0c5e7d013328f3656645e42 Mon Sep 17 00:00:00 2001 From: Daniel <22460147+dwinkler1@users.noreply.github.com> Date: Mon, 27 Jul 2026 00:16:50 +0000 Subject: [PATCH 3/8] chore: remove Stata tree-sitter parser from default parser list --- modules/module/specs/plugins.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/module/specs/plugins.nix b/modules/module/specs/plugins.nix index ff072cc..d8bc47d 100644 --- a/modules/module/specs/plugins.nix +++ b/modules/module/specs/plugins.nix @@ -36,7 +36,6 @@ let "rnoweb" "regex" "sql" - "stata" "toml" "vim" "vimdoc" From 2dc7227a0ecf906bfe9369cca8d0f59131c6d6a9 Mon Sep 17 00:00:00 2001 From: Daniel <22460147+dwinkler1@users.noreply.github.com> Date: Mon, 27 Jul 2026 00:21:18 +0000 Subject: [PATCH 4/8] fix: remove vscDebugger from default R packages (not in CRAN/rPackages) --- modules/module/settings/lang-packages.nix | 5 ++++- modules/module/specs/plugins.nix | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/module/settings/lang-packages.nix b/modules/module/settings/lang-packages.nix index 97ec4e7..3be7a9a 100644 --- a/modules/module/settings/lang-packages.nix +++ b/modules/module/settings/lang-packages.nix @@ -44,7 +44,10 @@ data_table janitor styler - vscDebugger + # vscDebugger is not on CRAN/Bioconductor, so it is not available in + # pkgs.rpkgs.rPackages. Install it manually in your R library if you + # want to use the nvim-dap R adapter (see plugin/26_dap.lua). + # vscDebugger lintr ]) ); diff --git a/modules/module/specs/plugins.nix b/modules/module/specs/plugins.nix index d003fbe..7630632 100644 --- a/modules/module/specs/plugins.nix +++ b/modules/module/specs/plugins.nix @@ -191,7 +191,7 @@ in { # Lazy-loaded plugins needed when the `r` cat is on. Kept separate from # `utils-lazy` so users with `r=true` and `utils=false` still get the - # R debugger (via vscDebugger) and in-buffer image rendering for plots. + # nvim-dap R adapter and in-buffer image rendering for plots. config.specs.r-lazy = lib.mkIf (config.cats.r or false) { lazy = true; data = with pkgs.vimPlugins; [ From 5c35787c68315479a0caec2c3c6451ac22302433 Mon Sep 17 00:00:00 2001 From: Daniel <22460147+dwinkler1@users.noreply.github.com> Date: Mon, 27 Jul 2026 00:24:33 +0000 Subject: [PATCH 5/8] fix: remove broken luaPackages.magick from markdown cat packages --- modules/module/settings/cat-packages.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/module/settings/cat-packages.nix b/modules/module/settings/cat-packages.nix index e68ff93..213f85c 100644 --- a/modules/module/settings/cat-packages.nix +++ b/modules/module/settings/cat-packages.nix @@ -51,7 +51,6 @@ in marksman texlab imagemagick - luaPackages.magick ]); nix = maybe "nix" (with pkgs; [ From ad26b17b8caf50bb8c14fc07b555c474ecc4cf0b Mon Sep 17 00:00:00 2001 From: Daniel <22460147+dwinkler1@users.noreply.github.com> Date: Mon, 27 Jul 2026 00:28:43 +0000 Subject: [PATCH 6/8] fix: avoid ripgrep dependency in devShell R_LIBS_SITE hook --- flake.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index db14f58..d55ec6f 100644 --- a/flake.nix +++ b/flake.nix @@ -69,7 +69,9 @@ '' + nixpkgs.lib.optionalString (config.cats.r or false) '' export R_HOME=$(R RHOME) - export R_LIBS_SITE=$(strings "$(command -v R)" | rg -o '/nix/store/[^:]+/library' | sort -u | paste -sd: -) + # Use R itself to discover the library paths, avoiding a dependency on + # ripgrep/strings/grep in the devShell PATH. + export R_LIBS_SITE=$(Rscript -e 'cat(.libPaths(), sep = ":")') export R_LIBS_USER="$PWD/.r-libs" mkdir -p "$R_LIBS_USER" ''; From 92bd53feeaa483f1686214f2793bf545726bdff6 Mon Sep 17 00:00:00 2001 From: Daniel <22460147+dwinkler1@users.noreply.github.com> Date: Mon, 27 Jul 2026 00:30:10 +0000 Subject: [PATCH 7/8] fix: add ripgrep to always category and revert shellHook to use rg --- flake.nix | 4 +--- modules/module/settings/cat-packages.nix | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index d55ec6f..db14f58 100644 --- a/flake.nix +++ b/flake.nix @@ -69,9 +69,7 @@ '' + nixpkgs.lib.optionalString (config.cats.r or false) '' export R_HOME=$(R RHOME) - # Use R itself to discover the library paths, avoiding a dependency on - # ripgrep/strings/grep in the devShell PATH. - export R_LIBS_SITE=$(Rscript -e 'cat(.libPaths(), sep = ":")') + export R_LIBS_SITE=$(strings "$(command -v R)" | rg -o '/nix/store/[^:]+/library' | sort -u | paste -sd: -) export R_LIBS_USER="$PWD/.r-libs" mkdir -p "$R_LIBS_USER" ''; diff --git a/modules/module/settings/cat-packages.nix b/modules/module/settings/cat-packages.nix index 213f85c..ee1a255 100644 --- a/modules/module/settings/cat-packages.nix +++ b/modules/module/settings/cat-packages.nix @@ -25,7 +25,9 @@ in }; config.catPkgs = { - always = maybe "always" (with pkgs; [ ]); + always = maybe "always" (with pkgs; [ + ripgrep + ]); clickhouse = maybe "clickhouse" (with pkgs; [ clickhouse-lts ]); From 180c3e4f55bf10bb5c8189f8772659a49ad4b8f7 Mon Sep 17 00:00:00 2001 From: Daniel <22460147+dwinkler1@users.noreply.github.com> Date: Mon, 27 Jul 2026 01:09:25 +0000 Subject: [PATCH 8/8] feat: add Harper grammar checker LSP --- modules/module/settings/cat-packages.nix | 1 + plugin/25_lsp.lua | 31 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/modules/module/settings/cat-packages.nix b/modules/module/settings/cat-packages.nix index ee1a255..dbdba3f 100644 --- a/modules/module/settings/cat-packages.nix +++ b/modules/module/settings/cat-packages.nix @@ -53,6 +53,7 @@ in marksman texlab imagemagick + harper ]); nix = maybe "nix" (with pkgs; [ diff --git a/plugin/25_lsp.lua b/plugin/25_lsp.lua index e249872..5250cdd 100644 --- a/plugin/25_lsp.lua +++ b/plugin/25_lsp.lua @@ -17,6 +17,37 @@ now_if_args(function() marksman = { filetypes = { "markdown", "markdown_inline", "codecompanion" }, }, + harper_ls = { + cmd = { "harper-ls", "--stdio" }, + filetypes = { "markdown", "quarto", "text", "tex", "typst" }, + root_markers = { ".git", ".harper" }, + settings = { + ["harper-ls"] = { + linters = { + SpellCheck = true, + SpelledNumbers = false, + AnA = true, + SentenceCapitalization = true, + UnclosedQuotes = true, + WrongApostrophe = false, + LongSentences = true, + RepeatedWords = true, + Spaces = true, + CorrectNumberSuffix = true, + }, + codeActions = { + ForceStable = false, + }, + markdown = { + IgnoreLinkTitle = false, + }, + diagnosticSeverity = "hint", + isolateEnglish = false, + dialect = "American", + maxFileLength = 120000, + }, + }, + }, nil_ls = { settings = { ["nil"] = {