[comp.editors] mapping tab

maart@cs.vu.nl (Maarten Litmaath) (11/14/89)

In article <3427@vax1.tcd.ie> ecarroll@vax1.tcd.ie (Eddy Carroll) writes:
\... is there any way to remap TAB to ^T in input mode? The
\obvious "map! ^V^I ^V^T" doesn't work (the ^I is echoed as a real tab, and
\treated as white space).

map! ^V^V^I ^V^T

But using this map, you can only put a tab at the begin of an insertion;
once you've inserted another character tab won't work anymore; you'd have
to escape the tab to get a real one:

	^V^I

This can be put into another macro:

	map! ^A ^V^V^V^V^V^I

(Yes, you need 5 ^V characters; work it out!)
Then how about the following map?

	map! ^V^V^V^I ^V^[a^V^T

This map first gets me out of insert mode through escape (^[), then puts me
back into insert mode (a) to append a ^T!  However, this doesn't work right
if the shiftwidth is smaller than 8. :-(  Furthermore you can only undo the
last tab.
You can't win.
-- 
"Richard Sexton is actually an AI program (or Construct, if you will) running
on some AT&T (R) 3B" (Richard Brosseau) | maart@cs.vu.nl, mcsun!botter!maart