Vim Recall繁體中文

Select the current or previous match

gN

Example

Normal 0 / 1
red blue red green red
Cursor on line 1, column 19

Select a match of the last search pattern, searching backward.

Before & after
Before
red blue red green red
Cursor on line 1, column 19
After
red blue red green red
Cursor on line 1, column 10 · Character selection

Start in Normal mode. The previous search pattern is red. Vim selects the matching text in the requested direction.

Details & Vim help

Example replayed in Vim

Select a match of the last search pattern, searching backward.

gN is the backward counterpart of gn. If already in Visual mode it can extend a selection, rather than simply selecting one isolated match.