-
Notifications
You must be signed in to change notification settings - Fork 9
Insert Mode
DJMcMayhem edited this page Jun 7, 2017
·
5 revisions
Certain commands only do things while in insert mode. A list of insert mode mappings in vanilla vim can be found here. A list of V-specific mappings can be found here:
Name | Mnemonic | Description |
---|---|---|
¬{char1}{char2} |
<M-,> |
Insert every character in the range [char1 - char2] . For example, ¬az will insert the lowercase alphabet, and ¬<space>} will insert all of printable ASCII. |
#Repchar
One of the best insert commands is "repchar". The mnemonics are <M-1>
, <M-2>
, <M-3>
... and they make n copies of the next character to be typed. For example, typing <M-5>a
in insert will insert the letter 'a' 5 times.
These also work with two digit numbers, so for example, <M-1><M-2>a
would insert 12 'a's. They can also be called from normal mode.
Since it never makes sense to call <M-1>a
(since a
is shorter) this will special case to inserting 10 'a's. Taking advantage of this can save one byte when you want 10 of a character.