[You may want to input text in all uppercase letters - maybe for a FORTRAN program. Using CAPS LOCK in vi can be a pain because you have to release CAPS LOCK almost every time you want to type a vi command. Here's a nice way to type lowercase letters during input and ex modes; they'll be mapped to uppercase automatically. -JP]
Try putting this in your .exrc (30.6) file:
map! a A map! b B map! c C ... map! z Z
Anytime you type (during text-input mode) an a
, the editor will map it into
A
.
What's that you say? You don't want this all the time?
Just put it in a file called .f (for FORTRAN), and type:
:source .f
when you want FORTRAN mode.
Of course, you can
define a function key (31.2)
to :source
this.
[After that, anywhere you want a lowercase letter, type CTRL-v first
to temporarily cancel the map.
For example, to type the command :w
, type
[:]
[CTRL-v]
[w]
You can also go into the ex command mode by typing
the vi command Q
.
That takes you to the ex colon (:
) prompt - where the
map! macros won't affect what you type.
To return to vi mode from ex command mode, type
:vi
. -JP ]
- in net.unix on Usenet, 9 October 1986