What is this screen in vim?

7

2

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

David Faux

Posted 2012-07-15T00:38:16.310

Reputation: 4 477

Answers

12

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.

fmanco

Posted 2012-07-15T00:38:16.310

Reputation: 2 287

2I 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 – 2012-07-15T01:22:04.127

It happens to me a lot also. But I use it so I cannot do this. But it is a great tip. – fmanco – 2012-07-15T04:04:44.767

The cedit key (defaults to Control-F) is the other way to open these history windows (after typing a normal :, /, or ?).

– Chris Johnsen – 2012-07-15T05:59:25.530

@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 – 2012-12-05T18:06:23.767

@criziot: It can also be closed like a regular vim window: :q or Ctrl-w q also work. – idbrii – 2012-12-05T18:07:47.277

@pydave: Good point, and I should have mentioned it. It's not a problem for me because I don't record mappings. (Yes, it's a powerful feature, but I just define a mapping instead.) – Heptite – 2012-12-05T20:00:47.550