Home Explore Blog CI



neovim

6th chunk of `runtime/doc/intro.txt`
29898610e55ff799c36bc944805783dddd6bcdd1cee950630000000100000fb1
 *keypad-multiply*
<kDivide>       keypad /                        *keypad-divide*
<kPoint>        keypad .                        *keypad-point*
<kComma>        keypad ,                        *keypad-comma*
<kEqual>        keypad =                        *keypad-equal*
<kEnter>        keypad Enter                    *keypad-enter*
<k0> - <k9>     keypad 0 to 9                   *keypad-0* *keypad-9*
<S-…>           shift-key                       *shift* *<S-*
<C-…>           control-key                     *control* *ctrl* *<C-*
<M-…>           alt-key or meta-key             *META* *ALT* *<M-*
<A-…>           same as <M-…>                   *<A-*
<T-…>           meta-key when it's not alt      *<T-*
<D-…>           command-key or "super" key      *<D-*


Note:

- Availability of some keys (<Help>, <S-Right>, …) depends on the UI or host
  terminal.
- If numlock is on the |TUI| receives plain ASCII values, so mapping <k0>,
  <k1>, ..., <k9> and <kPoint> will not work.
- Nvim supports mapping multibyte chars with modifiers such as `<M-ä>`. Which
  combinations actually work depends on the UI or host terminal.
- When a key is pressed using a meta or alt modifier and no mapping exists for
  that keypress, Nvim may behave as though <Esc> was pressed before the key.
- It is possible to notate combined modifiers (e.g. <M-C-T> for CTRL-ALT-T),
  but your terminal must encode the input for that to work. |tui-input|

                                                                *<>*
Examples are often given in the <> notation.  Sometimes this is just to make
clear what you need to type, but often it can be typed literally, e.g., with
the ":map" command.  The rules are:
1.  Printable characters are typed directly, except backslash and "<"
2.  Backslash is represented with "\\", double backslash, or "<Bslash>".
3.  Literal "<" is represented with "\<" or "<lt>".  When there is no
    confusion possible, "<" can be used directly.
4.  "<key>" means the special key typed (see the table above).  Examples:
    - <Esc>             Escape key
    - <C-G>             CTRL-G
    - <Up>              cursor up key
    - <C-LeftMouse>     Control- left mouse click
    - <S-F11>           Shifted function key 11
    - <M-a>             Meta- a  ('a' with bit 8 set)
    - <M-A>             Meta- A  ('A' with bit 8 set)

The <> notation uses <lt> to escape the special meaning of key names.  Using a
backslash also works, but only when 'cpoptions' does not include the 'B' flag.

Examples for mapping CTRL-H to the six characters "<Home>": >vim
        :imap <C-H> \<Home>
        :imap <C-H> <lt>Home>
The first one only works when the 'B' flag is not in 'cpoptions'.  The second
one always works.
To get a literal "<lt>" in a mapping: >vim
        :map <C-L> <lt>lt>

The notation can be used in a double quoted strings, using "\<" at the start,
e.g. "\<C-Space>".  This results in a special key code.  To convert this back
to readable text use `keytrans()`.

==============================================================================
Modes, introduction                             *vim-modes-intro* *vim-modes*

Vim has seven BASIC modes:

                                        *Normal* *Normal-mode* *command-mode*
- Normal mode:          In Normal mode you can enter all the normal editor
                        commands.  If you start the editor you are in this
                        mode.  This is also known as command mode.

- Visual mode:          This is like Normal mode, but the movement commands
                        extend a highlighted area.  When a non-movement
                        command is used, it is executed for the highlighted
                        area.  See |Visual-mode|.
                        If the 'showmode' option is on "-- VISUAL --" is shown
                        at the bottom of the window.

- Select mode:          This looks most like the MS-Windows selection mode.
                        Typing a printable character

Title: Keypad Keys, Modifier Keys, Special Key Notation, and Vim Modes Introduction
Summary
This section details notations for keypad keys and modifier keys. It explains the behavior of meta/alt keys and combined modifiers. It also covers how to use the <> notation, including examples of mapping special keys. Furthermore, it introduces Vim's seven basic modes, starting with Normal mode, which is also known as command mode, Visual mode, and Select mode. The modes dictate how Vim interprets commands and user input.