mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
neovim/spellcheck: add autogroup to spellcheck fts autocmd; fix vim-dirtytalk
This commit is contained in:
parent
f429379e34
commit
81eda5b340
2 changed files with 29 additions and 14 deletions
|
@ -7,16 +7,26 @@
|
|||
inherit (lib.nvim.dag) entryAfter;
|
||||
cfg = config.vim.spellcheck;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.programmingWordlist.enable) {
|
||||
config = mkIf cfg.programmingWordlist.enable {
|
||||
vim = {
|
||||
startPlugins = ["vim-dirtytalk"];
|
||||
|
||||
# vim-dirtytalk doesn't have any setup
|
||||
# but we would like to append programming to spelllang
|
||||
# as soon as possible while the plugin is enabled
|
||||
pluginRC.vim-dirtytalk = entryAfter ["basic"] ''
|
||||
-- append programming to spelllang
|
||||
vim.opt.spelllang:append("programming")
|
||||
spellcheck.enable = true;
|
||||
|
||||
# vim-dirtytalk doesn't have any setup but we would
|
||||
# like to append programming to spelllangs as soon as
|
||||
# possible while the plugin is enabled and the state
|
||||
# directory can be found.
|
||||
pluginRC.vim-dirtytalk = entryAfter ["spellcheck"] ''
|
||||
-- If Neovim can find (or access) the state directory
|
||||
-- then append "programming" wordlist from vim-dirtytalk
|
||||
-- to spelllang table. If path cannot be found, display
|
||||
-- an error and avoid appending the programming words
|
||||
if vim.fn.isdirectory(vim.fn.stdpath('state')) == 1 then
|
||||
vim.opt.spelllang:append("programming")
|
||||
else
|
||||
vim.notify("State path does not exist: " .. state_path, vim.log.levels.ERROR)
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue