Warm tip: This article is reproduced from stackoverflow.com, please click
search vim

How do you search through vim's command history?

发布于 2020-03-29 21:02:34

I would like to have the following search in Vim too

(reverse-i-search)`': 

Enter a word of your previous command, and you get the full command.

I know the chronological history tool in Vim

q:

However, it is not that useful as the reverse search.

How can you have a similar reverse search in Vim as in terminal?

Questioner
Léo Léopold Hertz 준영
Viewed
62
2,403 2017-11-06 16:19

Enter the first letters of your previous command and push <Up> arrow (or Ctrl+p).

:set li<up>
:set lines=75

Don't forget to check history option and set it to big enough value

:set history=1000