Vim Recall繁體中文

Insert the word under the cursor

Ctrl-r Ctrl-w

Example

Command-line 0 / 1
one two
three four
five six
keep
Cursor on line 1, column 1

Copy the cursor word into the command line.

Command line

Prompt
:echo 'red blue'
Insertion column
16
Editing mode
Insert
Completion menu
inactive

Vim messages

Empty
Last status message
Last warning
Before & after
Before
one two
three four
five six
keep
Cursor on line 1, column 1

Command line

Prompt
:echo 'red blue'
Insertion column
16
Editing mode
Insert
Completion menu
inactive

Vim messages

Empty
Last status message
Last warning
After
one two
three four
five six
keep
Cursor on line 1, column 1

Command line

Prompt
:echo 'red blue'one
Insertion column
19
Editing mode
Insert
Completion menu
inactive

Vim messages

Empty
Last status message
Last warning

Start in Command-line mode. A literal :echo prompt is already open. This key edits, moves within, cancels, or submits that prompt; the text buffer is separate.

Details & Vim help

Example replayed in Vim

Copy the cursor word into the command line.

While editing a : command or search prompt, Ctrl-r followed by Ctrl-w inserts the word under the buffer cursor. The text may need escaping when used as a search pattern.