aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/spellfile_local.vim
blob: aafe64efb568bb0400199d5af62092f533df3ca1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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