From f429379e34432e7789187da2856eae120d75f9b8 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 28 Oct 2024 20:05:01 +0300 Subject: [PATCH] docs: update release notes --- docs/release-notes/rl-0.7.md | 5 +++++ modules/neovim/init/spellcheck.nix | 36 +++++++++++++++--------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index bfd08b1..1a2a089 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -185,6 +185,7 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to default. - Refactor of `nvim-cmp` and completion related modules + - Remove `autocomplete.type` in favor of per-plugin enable options such as [](#opt-vim.autocomplete.nvim-cmp.enable). - Deprecate legacy Vimsnip in favor of Luasnip, and integrate @@ -277,9 +278,13 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to configuration for [dashboard.nvim](https://github.com/nvimdev/dashboard-nvim) - Update `lualine.nvim` input and add missing themes: + - Adds `ayu`, `gruvbox_dark`, `iceberg`, `moonfly`, `onedark`, `powerline_dark` and `solarized_light` themes. +- Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary + spellfiles to Neovim's runtime with ease. + [ppenguin](https://github.com/ppenguin): - Telescope: diff --git a/modules/neovim/init/spellcheck.nix b/modules/neovim/init/spellcheck.nix index c7b495f..16af3ee 100644 --- a/modules/neovim/init/spellcheck.nix +++ b/modules/neovim/init/spellcheck.nix @@ -98,30 +98,30 @@ in { config = mkIf cfg.enable { vim = { additionalRuntimePaths = let - spellfilesJoined = pkgs.symlinkJoin { - name = "nvf-spellfiles-joined"; - paths = mapAttrsToList (name: value: pkgs.writeTextDir "spell/${name}.add" (concatLines value)) cfg.extraSpellWords; - postBuild = '' - echo "Spellfiles joined" - ''; - }; - compileJoinedSpellfiles = pkgs.runCommandLocal "nvf-compile-spellfiles" { # Use the same version of Neovim as the user's configuration nativeBuildInputs = [config.vim.package]; - } '' - mkdir -p "$out/spell" - spellfilesJoined=$(find -L "${spellfilesJoined}/spell" -type f) - for spellfile in $spellfilesJoined; do - # Hacky way to ensure that the mangled extensions are omitted from the - # joined spellfiles. E.g. - local name=$(basename "$spellfile" ".add") - echo "Compiling spellfile: $spellfile" - nvim --headless --clean \ - --cmd "mkspell $out/spell/$name.add.spl $spellfile" -Es -n + spellfilesJoined = pkgs.symlinkJoin { + name = "nvf-spellfiles-joined"; + paths = mapAttrsToList (name: value: pkgs.writeTextDir "spell/${name}.add" (concatLines value)) cfg.extraSpellWords; + postBuild = "echo Spellfiles joined"; + }; + } '' + # Fail on unset variables and non-zero exit codes + # this might be the only way to trace when `nvim --headless` + # fails in batch mode + set -eu + + mkdir -p "$out/spell" + for spellfile in "$spellfilesJoined"/spell/*.add; do + name="$(basename "$spellfile" ".add")" + echo "Compiling spellfile: $spellfile" + nvim --headless --clean \ + --cmd "mkspell $out/spell/$name.add.spl $spellfile" -Es -n done + ''; in mkIf (cfg.extraSpellWords != {}) [