tags:

views:

725

answers:

2

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?

+3  A: 

Here are the docs for Vim's commandline history, also see this part of the docs on Vim's commandline history that covers the key bindings while in the history. It looks like you can say :foo and then hit the up arrow to find the last command that started with foo.

Chas. Owens
+7  A: 

Enter the first letters of your previous command and push <Up> arrow.

:set li<up>
:set lines=75

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

:set history=1000
Mykola Golubyev
If you have a Visor on Mac, try :set lines=48, instead. For some reason, the window expands too much with 75 lines.
Masi
75 is just for example purpose but thanks for Visor. I didn't know about this one though I never need one. But I like it!
Mykola Golubyev
I use not a terminal Vim but MacVim.
Mykola Golubyev