From: Oleg Broytman Date: Fri, 19 Jul 2019 17:22:07 +0000 (+0300) Subject: .vimrc: Automatically run `mkspell` when saving spell `.add` files X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=commitdiff_plain;h=2703a700a207a3a7b7c8326aaae312285c26bf87 .vimrc: Automatically run `mkspell` when saving spell `.add` files --- diff --git a/.vimrc b/.vimrc index a5314d4..4bb96bc 100644 --- a/.vimrc +++ b/.vimrc @@ -772,6 +772,15 @@ if has("spell") endif endfunction autocmd BufReadPost * call SetupSpell() + + function! SaveSpell() + if expand('%') == expand('~/.vim/spell/en.ascii.add') + mkspell! -ascii % + else + mkspell! % + endif + endfunction + autocmd BufWritePost ~/.vim/spell/*.add call SaveSpell() endif