Vim Recall繁體中文

Move to mode specified with 'insertmode', abandon command-line

Ctrl-\ Ctrl-g

Example

Command-line 0 / 1

Move to mode specified with 'insertmode', abandon command-line.

Command line

Prompt
:let g:exampleCount = 9
Insertion column
23
Editing mode
Insert
Completion menu
inactive

Command history

Empty

Vim messages

Empty
Last status message
Last warning

Example variables

g:exampleCount
0
Before & after

Before

Command line

Prompt
:let g:exampleCount = 9
Insertion column
23
Editing mode
Insert
Completion menu
inactive

Command history

Empty

Vim messages

Empty
Last status message
Last warning

Example variables

g:exampleCount
0

After

Command line

Prompt
Insertion column
0
Editing mode
Inactive
Completion menu
inactive

Command history

1
let g:exampleCount = 9

Vim messages

Empty
Last status message
Last warning

Example variables

g:exampleCount
0

Start in Command-line mode. The prompt contains a pending assignment of 9, while g:exampleCount is visibly 0. This cancellation leaves the variable at 0 because the assignment is not submitted.

Sample buffer
one two
three four
five six
keep
Cursor on line 1, column 1
Details & Vim help

Example replayed in Vim

Move to mode specified with 'insertmode', abandon command-line. Use while editing a : command or / or ? search prompt; this edits or controls that prompt rather than running an Ex command. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.