Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!metro!macuni!mqcomp!richard From: richard@mqcomp.mqcc.mq.OZ (Richard Miller) Newsgroups: comp.editors Subject: Re: Re: spelling from within vi Message-ID: <765@macuni.mqcc.mq.oz> Date: 14 Nov 90 04:37:20 GMT References: <1990Nov7.005405.461@investor.pgh.pa.us> <2230002@hpuplca.HP.COM> Sender: news@macuni.mqcc.mq.oz Reply-To: richard@mqcomp.mq.oz (Richard Miller) Organization: Macquarie University, School of Mathematics, Physics, Computing and Electronics Lines: 82 In article <2230002@hpuplca.HP.COM> joseph@hpuplca.HP.COM ( Joseph Hohl ) writes: >> In article <1990Oct31.153710.7865@cec1.wustl.edu> abed@saturn.wustl.edu (Abed Hammoud) writes: >> > >> > Is there a way I can use the unix spelling program ispell >> > or spell from within vi. if yes and some body have done it >> > please let me know how... >> >> I usually use :1,.$!spell. This replaces the buffer with your spelling >> errors, but u[ndo] restores the buffer. You can also say !}spell to do >> -- >> Bob Peirce, Pittsburgh, PA 412-471-5320 >> ...!uunet!pitt!investor!rbp rbp@investor.pgh.pa.us >> ---------- > >I use the following entry in my .exrc to use ispell: > > map S :w!^M:!ispell %^M:e!^^M^M ! The ^Ms are Cntl-Ms So what is this ispell thing ? I have a little shell script which I invoke from something like this !}spck or !!spck or what ever you like, and it will flag all the misspelt words with SPCK>. Once you have corrected the words you can run spck over it again and the SPCK> that are now correct disappear. I also have an uspck script which simply removes all the remaining SPCK>s since there are always so words that are not in the dictionary. Richard. PS. I also have some vi macros cut the word under cursor and add them to a list which can be appended the list spell(1) uses, I can dig them up an post 'em if anyone is interested. ------- SNIP -------------------------------------------------- #!/bin/sh # # spck # marks mis-spelt words in the input stream SPCK\>word # # Richard Miller # Sat Apr 25 02:20:43 EST 1987 SOURCE=/tmp/source$$ SEDFILE=/tmp/sedfile$$ if test $# = 0 then cat > $SOURCE else cat $* > $SOURCE fi echo s/SPCK\>//g > $SEDFILE sed 's/SPCK>//g' $SOURCE | spell | sed ' /^$/d s|^.*$|s/\\\<&\\\>/SPCK>&/g| ' >> $SEDFILE sed -f $SEDFILE $SOURCE rm -f $SEDFILE $SOURCE ------- SNIP -------------------------------------------------- #!/bin/sh # uspck # un-marks mis-spelt words which were marked SPCK\>word # # Richard Miller # Mon Jun 22 00:57:16 EST 1987 if test $# = 0 then sed 's/SPCK>//g' else sed 's/SPCK>//g' $* fi ____________________________________________________________________________ | __ | | /_/ -__ /_ _ _ _ __/ /\/\ -// _ | | / \ /(_ / /(_/ / (_/ / ////(~/ | | | | School Math, Physics, Elec and Computing, Macquarie University SYDNEY AUST.| | Email: richard@mqcomp.mqcs.mq.oz.au ,Ph:+61 2 8058374, Fax:+61 2 8058983 | |____________________________________________________________________________|