aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin/spellfile_local.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-12-19 17:19:41 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-12-19 17:19:41 +1300
commitba42c743f57ffbc0546c8c11fe92b3f95a15e6cc (patch)
tree58cd96aa4eee23c7a876618d30db1ab814b3a628 /vim/plugin/spellfile_local.vim
parentRemove complex 'spellfile' setting (diff)
downloaddotfiles-ba42c743f57ffbc0546c8c11fe92b3f95a15e6cc.tar.gz
dotfiles-ba42c743f57ffbc0546c8c11fe92b3f95a15e6cc.zip
Overhaul spellfile_local.vim plugin
Ready to be spun out into its own distribution shortly.
Diffstat (limited to 'vim/plugin/spellfile_local.vim')
-rw-r--r--vim/plugin/spellfile_local.vim18
1 files changed, 13 insertions, 5 deletions
diff --git a/vim/plugin/spellfile_local.vim b/vim/plugin/spellfile_local.vim
index f6918bfb..07307754 100644
--- a/vim/plugin/spellfile_local.vim
+++ b/vim/plugin/spellfile_local.vim
@@ -1,12 +1,20 @@
+"
+" spellfile_local.vim: Set extra 'spellfile' elements for full file paths and
+" filetype, to give the option of adding to file-specific or filetype-specific
+" spelling word lists.
+"
+" Author: Tom Ryder <tom@sanctum.geek.nz>
+" License: Same as Vim itself
+"
if exists('loaded_spellfile_local') || &compatible
finish
endif
let loaded_spellfile_local = 1
-command! -bar SetLocalSpellFiles
- \ call spellfile_local#()
-
+" For various events involving establishing or renaming a file buffer or
+" changing its filetype, rebuild the 'spellfile' definition accordingly
+"
augroup spellfile_local
- autocmd BufNew,BufRead *
- \ SetLocalSpellFiles
+ autocmd BufFilePost,BufNewFile,BufRead,EncodingChanged,FileType *
+ \ call spellfile_local#()
augroup END