diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-19 17:19:41 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-19 17:19:41 +1300 |
commit | ba42c743f57ffbc0546c8c11fe92b3f95a15e6cc (patch) | |
tree | 58cd96aa4eee23c7a876618d30db1ab814b3a628 /vim/plugin/spellfile_local.vim | |
parent | Remove complex 'spellfile' setting (diff) | |
download | dotfiles-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.vim | 18 |
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 |