| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# Spell a file & generate the syntax statements necessary to |
| 4 |
# highlight in vim. Based on a program from Krishna Gadepalli |
| 5 |
# <[email protected]>. |
| 6 |
# |
| 7 |
# I use the following mappings (in .vimrc): |
| 8 |
# |
| 9 |
# noremap <F8> :so `vimspell.sh %`<CR><CR> |
| 10 |
# noremap <F7> :syntax clear SpellErrors<CR> |
| 11 |
# |
| 12 |
# Neil Schemenauer <[email protected]> |
| 13 |
# March 1999 |
| 14 |
# |
| 15 |
# Version not updating original file Petr Kolar <[email protected]> |
| 16 |
# June 2002 |
| 17 |
|
| 18 |
OUTFILE=$1 |
| 19 |
|
| 20 |
shift |
| 21 |
ispell -l $* | sort -u | |
| 22 |
awk ' |
| 23 |
{ |
| 24 |
printf "syntax match SpellErrors \"\\<%s\\>\"\n", $0 ; |
| 25 |
} |
| 26 |
|
| 27 |
END { |
| 28 |
printf "highlight link SpellErrors ErrorMsg\n\n" ; |
| 29 |
} |
| 30 |
' > $OUTFILE |
| 31 |
echo "!/bin/rm $OUTFILE" >> $OUTFILE |