mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 08:39:50 +01:00
modules/neovim: rename vim.spellChecking
to vim.spellcheck
more consistent this way
This commit is contained in:
parent
5c7fd22c1d
commit
4d8dcc7e49
3 changed files with 14 additions and 10 deletions
|
@ -3,25 +3,29 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression literalMD;
|
||||
inherit (lib.modules) mkIf mkRenamedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) listOf str;
|
||||
inherit (lib.nvim.lua) listToLuaTable;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
cfg = config.vim.spellChecking;
|
||||
cfg = config.vim.spellcheck;
|
||||
in {
|
||||
options.vim.spellChecking = {
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["vim" "spellChecking"] ["vim" "spellcheck"])
|
||||
];
|
||||
|
||||
options.vim.spellcheck = {
|
||||
enable = mkEnableOption "neovim's built-in spellchecking";
|
||||
languages = mkOption {
|
||||
type = listOf str;
|
||||
default = ["en"];
|
||||
example = literalExpression ''["en" "de"]'';
|
||||
description = literalMD ''
|
||||
description = ''
|
||||
A list of languages that should be used for spellchecking.
|
||||
|
||||
To add your own language files, you may place your `spell`
|
||||
directory in either {path}`~/.config/nvim` or the
|
||||
directory in either `~/.config/nvim` or the
|
||||
[additionalRuntimePaths](#opt-vim.additionalRuntimePaths)
|
||||
directory provided by neovim-flake.
|
||||
'';
|
||||
|
@ -49,12 +53,12 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.luaConfigRC.spellchecking = entryAfter ["basic"] ''
|
||||
vim.luaConfigRC.spellcheck = entryAfter ["basic"] ''
|
||||
vim.opt.spell = true
|
||||
vim.opt.spelllang = ${listToLuaTable cfg.languages}
|
||||
|
||||
-- Disable spellchecking for certain filetypes
|
||||
-- as configured by `vim.spellChecking.ignoredFiletypes`
|
||||
-- as configured by `vim.spellcheck.ignoredFiletypes`
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
pattern = ${listToLuaTable cfg.ignoredFiletypes},
|
||||
callback = function()
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
cfg = config.vim.spellChecking;
|
||||
cfg = config.vim.spellcheck;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.programmingWordlist.enable) {
|
||||
vim = {
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
inherit (lib.modules) mkAliasOptionModule;
|
||||
in {
|
||||
imports = [
|
||||
(mkAliasOptionModule ["vim" "spellcheck" "vim-dirtytalk" "enable"] ["vim" "spellChecking" "programmingWordlist" "enable"])
|
||||
(mkAliasOptionModule ["vim" "spellcheck" "vim-dirtytalk" "enable"] ["vim" "spellcheck" "programmingWordlist" "enable"])
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue