mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
modules: move vim-dirtytalk to plugins/spellcheck
This commit is contained in:
parent
6011ec2bab
commit
b4384a833f
7 changed files with 48 additions and 8 deletions
|
@ -5,17 +5,15 @@
|
|||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption literalExpression mkOption;
|
||||
inherit (lib.strings) concatStringsSep optionalString;
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
inherit (lib.lists) optionals;
|
||||
inherit (lib.types) listOf str;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
cfg = config.vim.spellChecking;
|
||||
languages = cfg.languages ++ optionals cfg.enableProgrammingWordList ["programming"];
|
||||
in {
|
||||
options.vim.spellChecking = {
|
||||
enable = mkEnableOption "neovim's built-in spellchecking";
|
||||
enableProgrammingWordList = mkEnableOption "vim-dirtytalk, a wordlist for programmers, that includes programming words";
|
||||
languages = mkOption {
|
||||
type = listOf str;
|
||||
default = ["en"];
|
||||
|
@ -26,12 +24,10 @@ in {
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = optionals cfg.spellChecking.enableProgrammingWordList ["vim-dirtytalk"];
|
||||
configRC.spellchecking = entryAfter ["basic"] ''
|
||||
${optionalString cfg.enable ''
|
||||
set spell
|
||||
set spelllang=${concatStringsSep "," languages}
|
||||
''}
|
||||
" Spellchecking
|
||||
set spell
|
||||
set spelllang=${concatStringsSep "," cfg.languages}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue