modules/neovim: rename vim.spellChecking to vim.spellcheck

more consistent this way
This commit is contained in:
raf 2024-04-20 19:00:20 +03:00
parent 5c7fd22c1d
commit 4d8dcc7e49
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
3 changed files with 14 additions and 10 deletions

View file

@ -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()

View file

@ -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 = {

View file

@ -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"])
];
}