3 # Spell a file & generate the syntax statements necessary to
4 # highlight in vim. Based on a program from Krishna Gadepalli
5 # <krishna@stdavids.picker.com>.
7 # I use the following mappings (in .vimrc):
9 # noremap <F8> :so `vimspell.sh %`<CR><CR>
10 # noremap <F7> :syntax clear SpellErrors<CR>
12 # Neil Schemenauer <nascheme@ucalgary.ca>
16 OUTFILE
=/tmp
/vimspell.$$
17 # if you have "tempfile", use the following line
23 LOCAL_DICT
=${LOCAL_DICT-$HOME/local/lib/local_dict}
27 SPELL_ARGS
="+$LOCAL_DICT"
30 spell
$SPELL_ARGS $INFILE |
sort -u |
33 printf "syntax match SpellErrors \"\\<%s\\>\"\n", $0 ;
37 printf "highlight link SpellErrors ErrorMsg\n\n" ;
40 echo "!rm $OUTFILE" >> $OUTFILE