From 2703a700a207a3a7b7c8326aaae312285c26bf87 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 19 Jul 2019 20:22:07 +0300 Subject: [PATCH] .vimrc: Automatically run `mkspell` when saving spell `.add` files --- .vimrc | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.39.5