mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-05 04:51:14 +00:00
35 lines
838 B
Nix
35 lines
838 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf;
|
|
inherit (lib.options) mkEnableOption literalExpression mkOption;
|
|
inherit (lib.strings) concatStringsSep;
|
|
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"];
|
|
example = literalExpression ''["en" "de"]'';
|
|
description = "The languages to be used for spellchecking";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
vim = {
|
|
configRC.spellchecking = entryAfter ["basic"] ''
|
|
" Spellchecking
|
|
set spell
|
|
set spelllang=${concatStringsSep "," cfg.languages}
|
|
'';
|
|
};
|
|
};
|
|
}
|