When using vim, I sometimes get myself into this screen that has multiple command line rows. What is this screen for? How do I take advantage of it or get out of it?

enter image description here


That is the command line history window. Check here.

It appears when you type q: (you also have a search history if you type q/). This windows allows you to edit your command and search history. Press ctrl + c twice to cancel.

  • 2
    I found myself accidentally, frequently opening this window, and since I never use it anyway, I finally did this to prevent it: :nnoremap q <nop> – Heptite Jul 15 '12 at 1:22
  • It happens to me a lot also. But I use it so I cannot do this. But it is a great tip. – fmanco Jul 15 '12 at 4:04
  • The cedit key (defaults to Control-F) is the other way to open these history windows (after typing a normal :, /, or ?). – Chris Johnsen Jul 15 '12 at 5:59
  • @Heptite: Remapping q will prevent you from recording macros. Also, if you enter command line history window, you can type i and then work as normal (type your command and hit enter), but you have the benefit of hitting esc and then editing the command like a normal vim buffer. – idbrii Dec 5 '12 at 18:06
  • @criziot: It can also be closed like a regular vim window: :q or Ctrl-w q also work. – idbrii Dec 5 '12 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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