In bash and powershell.exe you can press ^R to bring up and search old commands.

I was wondering if vim had the same thing for ex mode and what the key combo is for that.

  • 1
    Do you really mean Ex mode? Or are you just talking about the command line?
    – Rich
    Commented May 23 at 9:06
  • @Rich Well it looks like Ex mode is a little different than pressing : in normal mode, but I meant :.
    – leeand00
    Commented May 23 at 20:36

1 Answer 1


command history

In Vim you can do: : commandprefix Up

E.g.: :ech Up

Using the Up and Down will navigate through your command history for command that starts with ech (echo 'foo', echo 'bar', ...)

command-line window

You can also do q: and go to the command-line window and search for command ther using Vim functionality like /ech Enter.

Remark: The list of commands considered can be displayed using the history command.

e.g.: To list the last 10 commands you type you can do:

:history : -10,
  • 1
    Also worth mentioning: :history. Unfortunately it doesn't support filtering yet. I'll fix that Commented May 23 at 5:38
  • 1
    Done. Now with patch 9.1.439 included, you can use :filter /pat/ :history Commented May 24 at 6:16
  • Great! I'll test it and I'll enrich the answer with the result of my test :-) Commented May 24 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.