diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-06-13 20:20:40 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-06-13 20:20:40 +0000 |
commit | 071d4279d6ab81b7187b48f3a0fc61e587b6db6c (patch) | |
tree | 221cbe3c40e043163c06f61c52a7ba2eb41e12ce /runtime/tools/vimspell.sh | |
parent | b4210b3bc14e2918f153a7307530fbe6eba659e1 (diff) |
updated for version 7.0001v7.0001
Diffstat (limited to 'runtime/tools/vimspell.sh')
-rwxr-xr-x | runtime/tools/vimspell.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/runtime/tools/vimspell.sh b/runtime/tools/vimspell.sh new file mode 100755 index 0000000000..42072222c9 --- /dev/null +++ b/runtime/tools/vimspell.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Spell a file & generate the syntax statements necessary to +# highlight in vim. Based on a program from Krishna Gadepalli +# <krishna@stdavids.picker.com>. +# +# I use the following mappings (in .vimrc): +# +# noremap <F8> :so `vimspell.sh %`<CR><CR> +# noremap <F7> :syntax clear SpellErrors<CR> +# +# Neil Schemenauer <nascheme@ucalgary.ca> +# March 1999 + +INFILE=$1 +OUTFILE=/tmp/vimspell.$$ +# if you have "tempfile", use the following line +#OUTFILE=`tempfile` + +# +# local spellings +# +LOCAL_DICT=${LOCAL_DICT-$HOME/local/lib/local_dict} + +if [ -f $LOCAL_DICT ] +then + SPELL_ARGS="+$LOCAL_DICT" +fi + +spell $SPELL_ARGS $INFILE | sort -u | +awk ' + { + printf "syntax match SpellErrors \"\\<%s\\>\"\n", $0 ; + } + +END { + printf "highlight link SpellErrors ErrorMsg\n\n" ; + } +' > $OUTFILE +echo "!rm $OUTFILE" >> $OUTFILE +echo $OUTFILE |