#!/bin/sh - umask 077 # vimspell - vim utility script to highlight spelling mistakes # Steve Kinzler, kinzler@cs.indiana.edu, Aug 04 # http://www.cs.indiana.edu/~kinzler/home.html#other # rewrite and expansion of the original vimspell script by # Krishna Gadepalli, krishna@stdavids.picker.com # noremap :wso `vimspell %`!vimspell % -r # NOTE: vim 7.0+ has builtin spellchecking, better than this in="$1" base=`basename "$in"` syn="${TMP-$HOME/tmp}/$base.syntax" rm -f "$syn" test "$2" = -r && exit spell=spell (aspell) > /dev/null 2>&1 && spell='aspell -l --mode=none' arg= ldict="${LOCAL_DICT-$HOME/local/lib/local_dict}" tdict=/tmp/vsw$$ trepl=/tmp/vsr$$ trap "rm -f $tdict $trepl; exit" 0 1 2 13 15 test -f "$ldict" && case "$spell" in *aspell*) (echo personal_ws-1.1 en 1; cat "$ldict") > $tdict (echo personal_repl-1.1 en 0) > $trepl arg="--repl=$trepl -p $tdict";; *) arg="+$ldict";; esac (echo 'syntax clear' $spell $arg < "$in" | sed 's/^/syntax match SpellErrors "\\"/' echo 'highlight link SpellErrors ErrorMsg') > "$syn" echo "$syn"