Vim Tips Wiki
Vim Tips Wiki
Advertisement

Mapping a key causes Vim to perform a sequence of operations when a specified key is pressed. See:

Keys to map[]

For information on which keys to map, see :help map-which-keys and :help keycodes and part 2 of the tutorial. It is also possible to map mouse events, see part 1 of the tutorial.

In insert mode, you can determine the name of a special key by pressing Ctrl-K then pressing the special key. For example, enter i to enter insert mode, then press Ctrl-K followed by Ctrl-Left (hold down the Ctrl key and press the left arrow key). Vim will insert the name of the key, namely <C-Left>.

The keys above the cursor arrows keys are:

  • <Insert>
  • <Del>
  • <Home>
  • <End>
  • <PageUp>
  • <PageDown>

The keys on the numeric keypad are:

  • <kDivide>
  • <kMultiply>
  • <kHome>
  • <kEnd>
  • <kPageUp>
  • <kPageDown>
  • <kMinus>
  • <kPlus>
  • <kEnter>
  • <kPoint>
  • <k0> to <k9>

Comments[]

I don't know whether to make this a "tip". Perhaps an overview with a quickref is useful? Should we think if a couple of pages like this might be created, but not given the "tip" template at the top? JohnBeckett (talk) 04:11, July 30, 2012 (UTC)

Advertisement