Home Explore Blog CI



neovim

9th chunk of `runtime/doc/intro.txt`
4873a984d50d1cfe987d4f086ac47857018f89c087745a700000000100000fb0
 --     :start     --                --
 Ex              :vi      --      --     --         --        --

 -- not possible
<

- 1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
    "A", "o", "O", "c", "C", "s" or S".
- 2 Go from Visual mode to Normal mode by giving a non-movement command, which
    causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V"
    (see |v_v|), which just stops Visual mode without side effects.
- 3 Go from Command-line mode to Normal mode by:
    - Hitting <CR> or <NL>, which causes the entered command to be executed.
    - Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>.
    - Hitting CTRL-C or <Esc>, which quits the command-line without executing
      the command.
    In the last case <Esc> may be the character defined with the 'wildchar'
    option, in which case it will start command-line completion.  You can
    ignore that and type <Esc> again.
- 4 Go from Normal to Select mode by:
    - use the mouse to select text while 'selectmode' contains "mouse"
    - use a non-printable command to move the cursor while keeping the Shift
      key pressed, and the 'selectmode' option contains "key"
    - use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd"
    - use "gh", "gH" or "g CTRL-H"  |g_CTRL-H|
- 5 Go from Select mode to Normal mode by using a non-printable command to move
    the cursor, without keeping the Shift key pressed.
- 6 Go from Select mode to Insert mode by typing a printable character.  The
    selection is deleted and the character is inserted.

                        *CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N*
                                      *v_CTRL-\_CTRL-N* *t_CTRL-\_CTRL-N*
Additionally the command CTRL-\ CTRL-N or <C-\><C-N> can be used to go to
Normal mode from any other mode.  This can be used to make sure Vim is in
Normal mode, without causing a beep like <Esc> would.  However, this does not
work in Ex mode.  When used after a command that takes an argument, such as
|f| or |m|, the timeout set with 'ttimeoutlen' applies.

        *CTRL-\_CTRL-G* *i_CTRL-\_CTRL-G* *c_CTRL-\_CTRL-G* *v_CTRL-\_CTRL-G*
CTRL-\ CTRL-G works the same as |CTRL-\_CTRL-N| for backward compatibility.

                                *gQ* *mode-Ex* *Ex-mode* *Ex* *EX* *E501*
gQ                      Switch to Ex mode.  This is like typing ":" commands
                        one after another, except:
                        - You don't have to keep pressing ":".
                        - The screen doesn't get updated after each command.
                        Use the `:vi` command (|:visual|) to exit this mode.

==============================================================================
Window contents                                         *window-contents*

In Normal mode and Insert/Replace mode the screen window will show the current
contents of the buffer: What You See Is What You Get.  There are two
exceptions:
- When the 'cpoptions' option contains '$', and the change is within one line,
  the text is not directly deleted, but a '$' is put at the last deleted
  character.
- When inserting text in one window, other windows on the same text are not
  updated until the insert is finished.

Lines longer than the window width will wrap, unless the 'wrap' option is off
(see below).  The 'linebreak' option can be set to wrap at a blank character.

If the window has room after the last line of the buffer, Vim will show '~' in
the first column of the last lines in the window, like this:
>
        +-----------------------+
        |some line              |
        |last line              |
        |~                      |
        |~                      |
        +-----------------------+
<
Thus the '~' lines indicate that the end of the buffer was reached.

If the last line in a window doesn't fit, Vim will indicate this with a '@' in
the first column of the last lines in the window, like this:
>
        +-----------------------+

Title: Detailed Instructions for Mode Switching and Ex Mode
Summary
This section gives numbered instructions on switching between different Vim modes, expanding on the table in the previous section. It covers transitions from Normal, Visual, Command-line, and Select modes, detailing specific keystrokes and commands. It also introduces the `<C-\><C-N>` command as an alternative to `<Esc>` for returning to Normal mode from any mode (except Ex mode), and explains how to enter and exit Ex mode (using the `gQ` and `:vi` commands respectively). Finally, the section discusses how Vim displays the buffer content in different modes, and how it indicates the end of the buffer or lines that don't fit the window.