Equivalent to <Esc>
Ctrl-[
Example
Command-line 0 / 1Normal 1 / 1Equivalent to <Esc>.
Command line
- Prompt
:let g:exampleCount = 9- Insertion column
23- Editing mode
Insert- Completion menu
inactive
Command history
Vim messages
Empty
- Last status message
- Last warning
Example variables
- g:exampleCount
0
Command applied
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
Before & after
Before
Command line
- Prompt
:let g:exampleCount = 9- Insertion column
23- Editing mode
Insert- Completion menu
inactive
Command history
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.
one two
three four
five six
keepCursor on line 1, column 1Details & Vim help
Example replayed in Vim
Equivalent to <Esc>. Outside completion-trigger handling, typed Escape abandons the prompt when cpoptions lacks x; otherwise it submits the current prompt. Escape configured as wildchar or wildcharm can trigger completion first. In mappings, Ctrl-c is the documented way to abandon the command line. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.