[comp.unix.wizards] VI map question

cja@zippy.eecs.umich.edu (Charles J. Antonelli) (08/17/88)

In article <1668@aplcomm.jhuapl.edu> @aplvax.jhuapl.edu:jwm@stdc.jhuapl.edu (Jim Meritt) writes:
>I am trying to get fmt mapped in my .exrc (to format and replace text) ...

i use:
	map @ {j!}fmt^M}be
hitting @ anywhere within a paragraph formats the paragraph, then positions
to the next paragraph.  you type ^V^M to put ^M in your .exrc (assuming ^V is
your `literal-next' character).  you can replace `fmt' with any legal shell
command line, which should answer your second question.

Charles J. Antonelli          Internet: cja@crim.eecs.umich.edu
44 ATL, 1101 Beal Ave.        Uucp: {ihnp4,umix,citi}!umich!eecs.umich.edu!cja
The University of Michigan    Phone: 313-936-9362
Ann Arbor, MI   49109-2210    "When the going gets tough, the tough reboot."

schaefer@ogcvax.ogc.edu (Barton E. Schaefer) (08/22/88)

In article <1069@zippy.eecs.umich.edu> cja@zippy.eecs.umich.edu
(Charles J. Antonelli) writes:
} In article <1668@aplcomm.jhuapl.edu> @aplvax.jhuapl.edu:jwm@stdc.jhuapl.edu
} (Jim Meritt) writes:
} >I am trying to get fmt mapped in my .exrc (to format and replace text) ...
} 
} i use:
} 	map @ {j!}fmt^M}be
} hitting @ anywhere within a paragraph formats the paragraph, then positions
} to the next paragraph.  you type ^V^M to put ^M in your .exrc (assuming ^V is
} your `literal-next' character).  you can replace `fmt' with any legal shell
} command line, which should answer your second question.

As long as you remember that you have to escape the pipe character `|', which
is used as the "ex" command separator.  You need to put an extra literal-next
character (usually ^V, as noted) into your .exrc file to accomplish this,
i.e.,
	map @ {j!}neqn~V|nroff -me^M}be

Sometimes, you even need an extra ^V in front of the ^M -- it depends on your
local vi peculiarities.  Note that you have to type TWO ^Vs to get one
inserted into the file.

-- 
Bart Schaefer			CSNET	schaefer@cse.ogc.edu
				UUCP	...{tektronix,verdix}!ogcvax!schaefer
    "... by definition the Turing test requires a machine capable of lying
    to people and misleading them."	-- Roger Zelazny, _Sign_of_Chaos_