Vim Recall繁體中文

Retrieve previous command-line from history that matches pattern before the cursor

<Up>

Example

Command-line 0 / 1

Retrieve previous command-line from history that matches pattern before the cursor.

Command line

Prompt
:
Insertion column
1
Editing mode
Insert
Completion menu
inactive

Command history

1
echo 1
2
echo 2

Vim messages

Empty
Last status message
Last warning
Before & after

Before

Command line

Prompt
:
Insertion column
1
Editing mode
Insert
Completion menu
inactive

Command history

1
echo 1
2
echo 2

Vim messages

Empty
Last status message
Last warning

After

Command line

Prompt
:echo 2
Insertion column
7
Editing mode
Insert
Completion menu
inactive

Command history

1
echo 1
2
echo 2

Vim messages

Empty
Last status message
Last warning

Start in Command-line mode.

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

Example replayed in Vim

Retrieve previous command-line from history that matches pattern before the cursor. 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.