myconfig

my config files
git clone https://a3nm.net/git/myconfig/
Log | Files | Refs | README

commit 1e147950de683c2b49e76f64bf902f68056679c4
parent f388e5b29be4f2512994431f3ef8aa972b2d696e
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Tue,  4 Sep 2018 08:02:50 +0200

spellchecking script

Diffstat:
vim/spell.vim | 23+++++++++++++++++++++++
1 file changed, 23 insertions(+), 0 deletions(-)

diff --git a/vim/spell.vim b/vim/spell.vim @@ -0,0 +1,23 @@ +fun! SpellNext() + " from https://vi.stackexchange.com/a/17267/ + " Go to start of buffer and enable spell checking. + normal! gg + set spell + + " Record cursor position. + let l:pos = getpos('.') + + " Special case: first word is misspelled. + if spellbadword()[1] isnot# '' + return + endif + + " Try to find a misspelled word. + normal! ]s + + " No more words left if the position is unchanged from last + " time, so quit Vim. + if getpos('.') == l:pos + quit + endif +endfun