Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / share / vim / vim58 / tools / vimspell.sh
blob42072222c9190468c09739e0e4a5f8185a934f41
1 #!/bin/sh
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>
13 # March 1999
15 INFILE=$1
16 OUTFILE=/tmp/vimspell.$$
17 # if you have "tempfile", use the following line
18 #OUTFILE=`tempfile`
21 # local spellings
23 LOCAL_DICT=${LOCAL_DICT-$HOME/local/lib/local_dict}
25 if [ -f $LOCAL_DICT ]
26 then
27 SPELL_ARGS="+$LOCAL_DICT"
30 spell $SPELL_ARGS $INFILE | sort -u |
31 awk '
33 printf "syntax match SpellErrors \"\\<%s\\>\"\n", $0 ;
36 END {
37 printf "highlight link SpellErrors ErrorMsg\n\n" ;
39 ' > $OUTFILE
40 echo "!rm $OUTFILE" >> $OUTFILE
41 echo $OUTFILE