2024-04-07 14:16:08 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib.modules) mkIf;
|
|
|
|
inherit (lib.options) mkEnableOption literalExpression mkOption;
|
2024-04-14 11:41:10 +00:00
|
|
|
inherit (lib.strings) concatStringsSep;
|
2024-04-07 14:16:08 +00:00
|
|
|
inherit (lib.lists) optionals;
|
|
|
|
inherit (lib.types) listOf str;
|
|
|
|
inherit (lib.nvim.dag) entryAfter;
|
|
|
|
|
|
|
|
cfg = config.vim.spellChecking;
|
|
|
|
in {
|
|
|
|
options.vim.spellChecking = {
|
|
|
|
enable = mkEnableOption "neovim's built-in spellchecking";
|
|
|
|
languages = mkOption {
|
|
|
|
type = listOf str;
|
|
|
|
default = ["en"];
|
2024-04-09 07:04:09 +00:00
|
|
|
example = literalExpression ''["en" "de"]'';
|
2024-04-07 14:16:08 +00:00
|
|
|
description = "The languages to be used for spellchecking";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
vim = {
|
|
|
|
configRC.spellchecking = entryAfter ["basic"] ''
|
2024-04-14 11:41:10 +00:00
|
|
|
" Spellchecking
|
|
|
|
set spell
|
|
|
|
set spelllang=${concatStringsSep "," cfg.languages}
|
2024-04-07 14:16:08 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|