Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: Re: Spell-checking a buffer in vi. Need help. Keywords: vi, spell Message-ID: <2236@solo10.cs.vu.nl> Date: 1 Apr 89 01:01:17 GMT References: <1856@umbc3.UMBC.EDU> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 30 rostamia@umbc3.UMBC.EDU (Rouben Rostamian) writes: \To spell-check the current buffer in vi I do the following: [deleted] \The net effect is that I obtain a list of my misspelled words appended to \the original buffer. \How do we automate this procedure? It seems reasonable to bind the \4-step sequence above to one key, say to ^A, by: \map ^A 1G "byG !Gspell^M "bP \where ^M represents a carriage return. \But somehow this does not work. \... Well, I haven't figured out (yet) why this doesn't work (the `!' seems to be the cause of trouble: map ^A 1G"byG works fine), but I've got a workaround: map ^A :w^M:$r!spell %^M However, undoing a `^A' reveals another bug: the last line of the original buffer is doubled! Further undoing leads to `interesting' effects too... Puzzle for the reader: Who is the connection between vi and csh? Hint: check recent postings on csh quirks. Disclaimer: vi's my editor, csh's my shell (sh's for shell scripts). -- Modeless editors and strong typing: |Maarten Litmaath @ VU Amsterdam: both for people with weak memories. |maart@cs.vu.nl, mcvax!botter!maart