Mercurial > vim
comparison runtime/tools/vimspell.sh @ 7:3fc0f57ecb91 v7.0001
updated for version 7.0001
author | vimboss |
---|---|
date | Sun, 13 Jun 2004 20:20:40 +0000 |
parents | |
children | 78423945b251 |
comparison
equal
deleted
inserted
replaced
6:c2daee826b8f | 7:3fc0f57ecb91 |
---|---|
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 # <krishna@stdavids.picker.com>. | |
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 <nascheme@ucalgary.ca> | |
13 # March 1999 | |
14 | |
15 INFILE=$1 | |
16 OUTFILE=/tmp/vimspell.$$ | |
17 # if you have "tempfile", use the following line | |
18 #OUTFILE=`tempfile` | |
19 | |
20 # | |
21 # local spellings | |
22 # | |
23 LOCAL_DICT=${LOCAL_DICT-$HOME/local/lib/local_dict} | |
24 | |
25 if [ -f $LOCAL_DICT ] | |
26 then | |
27 SPELL_ARGS="+$LOCAL_DICT" | |
28 fi | |
29 | |
30 spell $SPELL_ARGS $INFILE | sort -u | | |
31 awk ' | |
32 { | |
33 printf "syntax match SpellErrors \"\\<%s\\>\"\n", $0 ; | |
34 } | |
35 | |
36 END { | |
37 printf "highlight link SpellErrors ErrorMsg\n\n" ; | |
38 } | |
39 ' > $OUTFILE | |
40 echo "!rm $OUTFILE" >> $OUTFILE | |
41 echo $OUTFILE |