[comp.editors] Vi macro question

hansm@cwi.nl (Hans Mulder) (05/24/88)

In article <3365@saturn.ucsc.edu> joseph@chromo.ucsc.edu (Joseph Reger) writes:
>
>A question: I need a macro to type in accented characters in TeX, e.g.: \' or \".
>It is logical to me that I use the keys ' or " for this. But a macro definition
>:map! ' \'
>produces the error message: No tail recursion. 

Try:

:map! ' \^V^V' ^H

The ^Vs are control-Vs and you need to type four of them to get two, one of
which will eventually prevent the ' from being recursively expanded.
The space-backspace combination at the end fools the tail recursion check.

To enter a literal backspace into your file, you quote it with a ^V.
If you make a mistake in a :map! command and make a second attempt, you
also quote the ' (or whatever) with ^V to prevent it from being expanded.
So you may have to type

:map! ^V' \^V^V^V^V^V' ^V^H

to obtain the command above.  And, of course, if you ever want to type a '
that should not be map!ped to \' you quote it with ^V.

Hans Mulder	hansm@cwi.nl	mcvax!hansm