Sometimes in Vim, I'm typing a command and realise that I could really use Vim's motion commands for navigating the command-line:

  • :s/somthing/else/
  • realise that I misspelled something.
  • Fmae and be done with it.

Of course, trying this would just put Fmae at the end of the command. Is there any way to get (a subset of) the vim commands into the vim command-line? After all, that's what it does.

2 Answers 2


When i need to edit a long command in command line, i use q+:

then i see a list of my last commands and i can move with regular vim motions and it's easy to edit.


Use Ctrl+F on the command line.

It will bring you to the same pop-up window as q: would bring you in normal mode. You can edit any command there. To execute press Enter.

As a bonus use the same Ctrl+F in search mode as well or use q\ in normal mode

The Mnemonic for F in Ctrl+F might be Full history, Find in history

Your Answer

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