Path: utzoo!attcan!uunet!wuarchive!cs.utexas.edu!mayoff From: mayoff@cs.utexas.edu (Robert Mayoff) Newsgroups: comp.editors Subject: Re: spelling from within vi Message-ID: <980@tokio.cs.utexas.edu> Date: 31 Oct 90 18:14:02 GMT References: <1990Oct31.153710.7865@cec1.wustl.edu> Distribution: na Organization: Dept of Computer Sciences, UTexas, Austin Lines: 34 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 use ispell. Here's the macro I use (straight from my .exrc): " *c to check the spelling with ispell. map *c :w^V^M:!ispell %^V^M:e!^V^M^V^M Note that if you want to type this in to vi, just type it as shown (with a colon before the "map" command, of course). If you want it in your .exrc, you must type control-V before each of the control characters, to actually get the control-V's in your .exrc file. This will save the file, run ispell on it (vi expands the % to the current filename), and then re-edit the file when ispell exits (in case ispell changed the file because there were errors). If you want to use the standard spell, you'll have to do more work - spell only lists words it doesn't know, and doesn't give you the opportunity to change them. Here's what you can use: map *c :w^V^M1GO---End of Spelling List---^V^[:0r !spell %^V^M^V^M This will save your file, then run spell on it and put the output of spell at the beginning of your file. The end of spell's output will be marked by the line "---End of Spelling List---". Hope this helps. -- /_ rob /_ Fun things to do with UNIX (#12 in a series): / cd /dev; cat mouse # Try this on a Sun. Really!