neovim/spellcheck: add autogroup to spellcheck fts autocmd; fix vim-dirtytalk

This commit is contained in:
raf 2024-10-30 15:27:30 +03:00
commit b836b39941
Signed by: NotAShelf
GPG key ID: AF26552424E53993
2 changed files with 23 additions and 13 deletions

View file

@ -81,18 +81,16 @@ in {
'';
};
/*
# FIXME: This needs to be revisited. It tries to install
# the spellfile to an user directory, but it cannot do so
# as we sanitize runtime paths.
programmingWordlist.enable = mkEnableOption ''
vim-dirtytalk, a wordlist for programmers containing
common programming terms.
Setting this value as `true` has the same effect
as setting {option}`vim.spellCheck.enable`
::: {.note}
Enabling this option will unconditionally set
{option}`vim.spellcheck.enable` to true as vim-dirtytalk
depends on spellchecking having been set up.
:::
'';
*/
};
config = mkIf cfg.enable {
@ -136,7 +134,9 @@ in {
-- Disable spellchecking for certain filetypes
-- as configured by `vim.spellcheck.ignoredFiletypes`
vim.api.nvim_create_augroup("nvf_autocmds", {clear = false})
vim.api.nvim_create_autocmd({ "FileType" }, {
group = "nvf_autocmds",
pattern = ${listToLuaTable cfg.ignoredFiletypes},
callback = function()
vim.opt_local.spell = false