Hence, typing Ctrl-v + Shift-Down_arrow will produce ^[[1 2B.
Arrow keysTo enter a terminal keycode in Vim, first type Ctrl-v, followed by the keystroke we want to obtain the term keycode from. A useful collection of Vim 8.2 quick reference cheat sheets to help you learn vim editor faster. Hence, typing Ctrl-v then Esc will produce ^[. To enter a literal character in Vim, first type Ctrl-v, followed by a single keystroke. Entering literal characters & terminal codes Įither in the :command line, or in insert mode: For this we need mappings (see section 2b).ġd. Shift-Down_arrow should now work, but the Ctrl-Shift-Down_arrow keycode can not be set in the same way. To move the cursor: Command, Moves the cursor SPACE, l (el), or right arrow, space to the right h or left arrow, space to the left j or down arrow, down one. Once the correct terminal keycode is assigned to the appropriate Vim keycode, the keystroke should work in terminal Vim. The following is not allowed because the keycode is not a listed Vim keycode: Where ^[ is a literal ESC special character. For example, to manually set the keycode for Shift-Down_arrow: The only difference is that we can :set internal keycodes. They are easy to read, quite intuitive, and are almost treated the same by Vim. Go to the beginning of a page (beginning of the document if Continuous is selected in the main menu in the top. Ctrl + L followed by the page number and Enter. Vim keycodes look a lot like the keystrokes we would define in a mapping. Move up/down a page several lines at a time. More on this later in section 2b.īe careful when setting these keycodes. We can use this to our advantage to create more "responsive" mappings. In addition to the Vim keycodes listed in the help section above, the keycodes for the function keys actually go up to F37. Enter :set termcap to list the terminal keycodes (see :help terminal-options).
#Vim page down shortcut key manual
To obtain a list of terminal keycodes, look it up in the manual for that terminal.įor a list of Vim's internal keycodes, see :help t_ku.
Vim can act upon its own keycodes, and leave the assignment of terminal keycodes to autodetection (or to manual setup by the user, which is what this guide is for). It was originally released for Amiga but it has since been developed to be cross-platform. Vim needs its own representation of keycodes because it runs on a variety of platforms. Vim is a text editor, than can be used from a command line interface and as a standalone application in a graphical interface. These are actual bytes that are sent to Vim by the terminal when we type Shift-Up, for example (on an xterm).
Terminal keycodes look something likeĪnd press any keys. There are two types of keycodes: terminal keycodes and Vim keycodes. Entering literal characters & terminal codes