Sometimes windows like this pop up. I can get out of with with :q
but I wonder, how did i end up with this? Maybe there is some keystroke combinations involved but I have no idea. Can you link me with relevant information for this feature of vim?
4 Answers
It's the command-line window.
You invoke it with q:
and you can read all about it in :help cmdline-window
.
In short: you get access to your latest Ex commands and a chance to edit them and re-execute them with all of Vim's editing power.

- 186,200
- 21
- 280
- 313
-
Also: it can be closed like any other window, or by pressing enter on any element of the history (which executes it). – Jean-Marie Comets Aug 20 '13 at 12:49
-
Pressing `
` will close the window and return you to the command line. See `:h E199` for more information on closing the cmdline-window. However if you are like me and want to use ` – Peter Rincker Aug 20 '13 at 13:38` to close the window then add this to your `~/.vimrc` file: `autocmd CmdwinEnter * nnoremap :q `
it is command-line window. You could open it by pressing q:
or ctrl-f (in command line)
to close it, you could :q
for more details, check :h q:
I think it is good feature. We can not only choose previous command from that window, but also edit command with vim way.
similarly vim has q/
too. search history.

- 189,393
- 32
- 233
- 301
As above answers refer, it is a feature called 'command-line window'.
Usually it is a typo of :q
, you can disable it by
nnoremap q: :q

- 2,854
- 21
- 24
See other answers for explanation of "what" the window is.
I'll address how to close the window since that part seems to have been overlooked:
use <C-c>
(ctrl + 'C').

- 3,354
- 5
- 26
- 33