From 4d8dcc7e49c084c17d824ae3a7008f00eb296afc Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 20 Apr 2024 19:00:20 +0300 Subject: [PATCH] modules/neovim: rename `vim.spellChecking` to `vim.spellcheck` more consistent this way --- modules/neovim/init/spellcheck.nix | 20 +++++++++++-------- .../spellcheck/vim-dirtytalk/config.nix | 2 +- .../vim-dirtytalk/vim-dirtytalk.nix | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/modules/neovim/init/spellcheck.nix b/modules/neovim/init/spellcheck.nix index 71607ac..1995532 100644 --- a/modules/neovim/init/spellcheck.nix +++ b/modules/neovim/init/spellcheck.nix @@ -3,25 +3,29 @@ lib, ... }: let - inherit (lib.modules) mkIf; - inherit (lib.options) mkOption mkEnableOption literalExpression literalMD; + inherit (lib.modules) mkIf mkRenamedOptionModule; + inherit (lib.options) mkOption mkEnableOption literalExpression; inherit (lib.types) listOf str; inherit (lib.nvim.lua) listToLuaTable; inherit (lib.nvim.dag) entryAfter; - cfg = config.vim.spellChecking; + cfg = config.vim.spellcheck; in { - options.vim.spellChecking = { + imports = [ + (mkRenamedOptionModule ["vim" "spellChecking"] ["vim" "spellcheck"]) + ]; + + options.vim.spellcheck = { enable = mkEnableOption "neovim's built-in spellchecking"; languages = mkOption { type = listOf str; default = ["en"]; example = literalExpression ''["en" "de"]''; - description = literalMD '' + description = '' A list of languages that should be used for spellchecking. To add your own language files, you may place your `spell` - directory in either {path}`~/.config/nvim` or the + directory in either `~/.config/nvim` or the [additionalRuntimePaths](#opt-vim.additionalRuntimePaths) directory provided by neovim-flake. ''; @@ -49,12 +53,12 @@ in { }; config = mkIf cfg.enable { - vim.luaConfigRC.spellchecking = entryAfter ["basic"] '' + vim.luaConfigRC.spellcheck = entryAfter ["basic"] '' vim.opt.spell = true vim.opt.spelllang = ${listToLuaTable cfg.languages} -- Disable spellchecking for certain filetypes - -- as configured by `vim.spellChecking.ignoredFiletypes` + -- as configured by `vim.spellcheck.ignoredFiletypes` vim.api.nvim_create_autocmd({ "FileType" }, { pattern = ${listToLuaTable cfg.ignoredFiletypes}, callback = function() diff --git a/modules/plugins/spellcheck/vim-dirtytalk/config.nix b/modules/plugins/spellcheck/vim-dirtytalk/config.nix index edfe1c7..bef92e5 100644 --- a/modules/plugins/spellcheck/vim-dirtytalk/config.nix +++ b/modules/plugins/spellcheck/vim-dirtytalk/config.nix @@ -5,7 +5,7 @@ }: let inherit (lib.modules) mkIf; inherit (lib.nvim.dag) entryAfter; - cfg = config.vim.spellChecking; + cfg = config.vim.spellcheck; in { config = mkIf (cfg.enable && cfg.programmingWordlist.enable) { vim = { diff --git a/modules/plugins/spellcheck/vim-dirtytalk/vim-dirtytalk.nix b/modules/plugins/spellcheck/vim-dirtytalk/vim-dirtytalk.nix index d996fef..d20bd62 100644 --- a/modules/plugins/spellcheck/vim-dirtytalk/vim-dirtytalk.nix +++ b/modules/plugins/spellcheck/vim-dirtytalk/vim-dirtytalk.nix @@ -2,6 +2,6 @@ inherit (lib.modules) mkAliasOptionModule; in { imports = [ - (mkAliasOptionModule ["vim" "spellcheck" "vim-dirtytalk" "enable"] ["vim" "spellChecking" "programmingWordlist" "enable"]) + (mkAliasOptionModule ["vim" "spellcheck" "vim-dirtytalk" "enable"] ["vim" "spellcheck" "programmingWordlist" "enable"]) ]; }