mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 14:55:59 +01: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
17
flake.lock
17
flake.lock
|
@ -1491,6 +1491,7 @@
|
||||||
"toggleterm-nvim": "toggleterm-nvim",
|
"toggleterm-nvim": "toggleterm-nvim",
|
||||||
"tokyonight": "tokyonight",
|
"tokyonight": "tokyonight",
|
||||||
"trouble": "trouble",
|
"trouble": "trouble",
|
||||||
|
"vim-dirtytalk": "vim-dirtytalk",
|
||||||
"vim-illuminate": "vim-illuminate",
|
"vim-illuminate": "vim-illuminate",
|
||||||
"vim-markdown": "vim-markdown",
|
"vim-markdown": "vim-markdown",
|
||||||
"vim-repeat": "vim-repeat",
|
"vim-repeat": "vim-repeat",
|
||||||
|
@ -1788,6 +1789,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"vim-dirtytalk": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1690722430,
|
||||||
|
"narHash": "sha256-kjyLwkAk6mqK7u4+zAr+Yh+zbSiukNKtXwb7t39LUco=",
|
||||||
|
"owner": "psliwka",
|
||||||
|
"repo": "vim-dirtytalk",
|
||||||
|
"rev": "a49251dce1852875951d95f7013979ece5caebf0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "psliwka",
|
||||||
|
"repo": "vim-dirtytalk",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"vim-illuminate": {
|
"vim-illuminate": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
|
@ -456,6 +456,12 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Spellchecking
|
||||||
|
vim-dirtytalk = {
|
||||||
|
url = "github:psliwka/vim-dirtytalk";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Terminal
|
# Terminal
|
||||||
toggleterm-nvim = {
|
toggleterm-nvim = {
|
||||||
url = "github:akinsho/toggleterm.nvim";
|
url = "github:akinsho/toggleterm.nvim";
|
||||||
|
|
|
@ -8,7 +8,10 @@ with builtins; let
|
||||||
cfg = config.vim;
|
cfg = config.vim;
|
||||||
in {
|
in {
|
||||||
config = {
|
config = {
|
||||||
vim.startPlugins = ["plenary-nvim"];
|
vim.startPlugins =
|
||||||
|
if cfg.spellChecking.enableProgrammingWordList
|
||||||
|
then ["plenary-nvim" "vim-dirtytalk"]
|
||||||
|
else ["plenary-nvim"];
|
||||||
|
|
||||||
vim.maps.normal =
|
vim.maps.normal =
|
||||||
mkIf cfg.disableArrows {
|
mkIf cfg.disableArrows {
|
||||||
|
@ -140,7 +143,7 @@ in {
|
||||||
''}
|
''}
|
||||||
${optionalString cfg.spellChecking.enable ''
|
${optionalString cfg.spellChecking.enable ''
|
||||||
set spell
|
set spell
|
||||||
set spelllang=${toString cfg.spellChecking.language}
|
set spelllang=${builtins.concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"}
|
||||||
''}
|
''}
|
||||||
${optionalString (cfg.leaderKey != null) ''
|
${optionalString (cfg.leaderKey != null) ''
|
||||||
let mapleader = "${toString cfg.leaderKey}"
|
let mapleader = "${toString cfg.leaderKey}"
|
||||||
|
|
|
@ -31,11 +31,12 @@ with builtins; {
|
||||||
|
|
||||||
spellChecking = {
|
spellChecking = {
|
||||||
enable = mkEnableOption "neovim's built-in spellchecking";
|
enable = mkEnableOption "neovim's built-in spellchecking";
|
||||||
language = mkOption {
|
enableProgrammingWordList = mkEnableOption "adds vim-dirtytalk, a wordlist for programmers, that includes programming words";
|
||||||
type = types.str;
|
languages = mkOption {
|
||||||
description = "The language to be used for spellchecking";
|
type = types.listOf types.str;
|
||||||
default = "en_US";
|
description = "The languages to be used for spellchecking";
|
||||||
example = "de";
|
default = ["en_US"];
|
||||||
|
example = ["en_US" "de"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue