Joel Hammer wrote:

> I use vi.

I'm sorry to hear that.

No, no, just kidding.  I use it too. ;-)

> The biggest nuisance I have with it is constantly having to hit the esc
> button to exit the insert mode. I have remapped my ; key to do this. But,
> now I have to type cntrl-v59 to insert a semicolon into my document.

I assume you used map! to remap the ; key and the F2 key.  You can change this
behavior (macros calling other macros) by setting noremap:

:set noremap

If you want remap set, just unset it and reset it in the macro.  Try this:

map! <F2> ^[:set noremap^Ma;^[:set remap^Ma
map! ; ^[

The <F2> represents pressing the F2 key, ^[ means ctrl-vESC, and ^M means
ctrl-vctrl-m.   If you reverse the order of the map! commands, you'll have to
use ctrl-v; rather than ; in the top one.

I tested this in gvim 5.8, but I got the idea from a paper on vi so it should
work for you.  The paper ("Vi Macros, Abbreviations, and Buffers" by Fred Buck)
is available here:

http://www.mathsci.appstate.edu/~egp/misc/vi/macros

Dave


_______________________________________________
Linux-users mailing list
Archives, Digests, etc at http://linux.nf/mailman/listinfo/linux-users

Reply via email to