Spell-checking a buffer in vi. Need help.

Maarten Litmaath maart at cs.vu.nl
Sat Apr 1 11:01:17 AEST 1989


rostamia at 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 at cs.vu.nl, mcvax!botter!maart



More information about the Comp.unix.questions mailing list