[comp.sys.att] vi macro with carriage return

tanya@adds.newyork.NCR.COM (Tanya Katz) (08/08/89)

I am trying to map some keys in vi on the Unix-PC and am having
a problem that seems peculiar to this machine's version of vi.

If I map a key to something containing a ctrl-M or carriage return,
the ^M gets echoed but not interpreted.  How can I tell vi to interpret
the control characters?

Eg:

map N :w^M:n^M

(where the ^M represents a ctrl-V followed by an M)
maps the Shifted N to the sequence :w\n:n\n

This works fine on various flavors of unix-vi, but on the Unix-PC,
the characters appear on the vi command line & they just sit there waiting
for me to press return.

Anyone know what I'm doing wrong here?

Thanks,
	Tanya

#-------------------------------------------------#
| Tanya Katz                  (516) 231-5400 x430 |
|                                                 |
| 	...uunet!ncrlnk!adds!tanya                |
| 	tanya.katz@adds.newyork.ncr.com           |
|                                                 |
| ADDS Inc, 100 Marcus Blvd, Hauppauge, NY 11788  |
#-------------------------------------------------#

pjh@mccc.UUCP (Pete Holsberg) (08/10/89)

In article <1127@adds.newyork.NCR.COM> tanya@adds.newyork.NCR.COM (Tanya Katz) writes:
=If I map a key to something containing a ctrl-M or carriage return,
=the ^M gets echoed but not interpreted.  How can I tell vi to interpret
=the control characters?
=
=Eg:
=
=map N :w^M:n^M
=
=(where the ^M represents a ctrl-V followed by an M)
=maps the Shifted N to the sequence :w\n:n\n

Try ctrl-V followed by CR, perhaps even ctrl-V ctrl-V CR.

Pete

-- 
Pete Holsberg -- Mercer College -- Trenton, NJ 08690
...!rutgers!princeton!njsmu!mccc!pjh