aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin/spellfile_local.vim
blob: b04b7573a76810ddd2cb828576d1248eb18e5c10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
if exists('loaded_spellfile_local')
  finish
endif
let loaded_spellfile_local = 1

let s:spellfile = join([
      \ substitute(v:lang, '_.*', '', ''),
      \ &encoding
      \ ], '.') . '.add'
Establish $MYVIM/cache/spell
execute 'set spellfile=$MYVIM/cache/spell/'.s:spellfile

command! AddLocalSpellFile
      \ call spellfile_local#()

augroup spellfile_local
  autocmd BufNew,BufRead *
        \ AddLocalSpellFile
augroup END