aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/spellfile_local.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/autoload/spellfile_local.vim')
-rw-r--r--vim/autoload/spellfile_local.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/vim/autoload/spellfile_local.vim b/vim/autoload/spellfile_local.vim
new file mode 100644
index 00000000..aafe64ef
--- /dev/null
+++ b/vim/autoload/spellfile_local.vim
@@ -0,0 +1,11 @@
+function! spellfile_local#() abort
+ let spellfile = join([
+ \ substitute(expand('%:p'), '[^0-9A-Za-z_.-]', '%', 'g'),
+ \ substitute(v:lang, '_.*', '', ''),
+ \ &encoding
+ \ ], '.') . '.add'
+ Establish $MYVIM/cache/spell/local
+ execute 'setlocal spellfile+=$MYVIM/cache/spell/local/'.spellfile
+ nnoremap <buffer> zG 2zg
+ xnoremap <buffer> zG 2zg
+endfunction