mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
feat(spell): add multiple language support and vim-dirtytalk
BREAKING CHANGE: `vim.spellChecking.language` is replaced with `vim.spellChecking.languages`
This commit is contained in:
parent
6173845515
commit
31c237d149
4 changed files with 34 additions and 7 deletions
|
@ -8,7 +8,10 @@ with builtins; let
|
|||
cfg = config.vim;
|
||||
in {
|
||||
config = {
|
||||
vim.startPlugins = ["plenary-nvim"];
|
||||
vim.startPlugins =
|
||||
if cfg.spellChecking.enableProgrammingWordList
|
||||
then ["plenary-nvim" "vim-dirtytalk"]
|
||||
else ["plenary-nvim"];
|
||||
|
||||
vim.maps.normal =
|
||||
mkIf cfg.disableArrows {
|
||||
|
@ -140,7 +143,7 @@ in {
|
|||
''}
|
||||
${optionalString cfg.spellChecking.enable ''
|
||||
set spell
|
||||
set spelllang=${toString cfg.spellChecking.language}
|
||||
set spelllang=${builtins.concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"}
|
||||
''}
|
||||
${optionalString (cfg.leaderKey != null) ''
|
||||
let mapleader = "${toString cfg.leaderKey}"
|
||||
|
|
|
@ -31,11 +31,12 @@ with builtins; {
|
|||
|
||||
spellChecking = {
|
||||
enable = mkEnableOption "neovim's built-in spellchecking";
|
||||
language = mkOption {
|
||||
type = types.str;
|
||||
description = "The language to be used for spellchecking";
|
||||
default = "en_US";
|
||||
example = "de";
|
||||
enableProgrammingWordList = mkEnableOption "adds vim-dirtytalk, a wordlist for programmers, that includes programming words";
|
||||
languages = mkOption {
|
||||
type = types.listOf types.str;
|
||||
description = "The languages to be used for spellchecking";
|
||||
default = ["en_US"];
|
||||
example = ["en_US" "de"];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue