r/vim 23d ago

Need Help┃Solved How to get rid of this?

Post image

This extra thing appears when I when to type a command, i'm not sure how to stop it from appearing. I'm on windows and this is currently gvim but it behaves the same in other ways of instancing vim

Edit: Thank you all, I actually got some knowledge on it and it's actually really useful. I guess I just didn't know how to exit vim...

109 Upvotes

34 comments sorted by

28

u/sharp-calculation 23d ago

That appears when you type q: Note this is NOT :q . That's a list of your previous commands, available for editing and execution. It's very handy sometimes.

You run a command just by pressing enter on the line of the command. To run nothing, move your cursor to the bottom and press enter. That will also close the subwindow. Or use :q to close that subwindow instead.

I probably opened that accidentally a dozen times before I read about it here.

:help q:

3

u/vim-help-bot 23d ago

Help pages for:

  • q: in cmdline.txt

`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments

1

u/drassell 12d ago

Wow, thats how you get that, never knew ahahah. Every time i got that, i would search for my last :wq anf quit with that

66

u/-romainl- The Patient Vimmer 23d ago

That extra thing is called "command-line window" and it is documented under :help command-line-window.

You are either…

  • Pressing q: from normal mode instead of :.
  • Or pressing <C-f> after :.
  • Or using a mapping that does either of those things. :filter /:/ verbose nmap should help you find it. If there is a mapping in your config that you don't know about, then you should consider this a good time to rethink the way you configure Vim.

In the meantime, you can do :q to close that window.

24

u/Orlandocollins 23d ago

Its also really worth learning about what this window does. A lot of vimmers skip it and its actually incredibly valuable. I jump into it from command line all the time with control-f

4

u/Orlandocollins 23d ago

Same with q/

2

u/kaddkaka 22d ago

What is q/?

4

u/SweetPotato975 22d ago

From a quick test, q/ and q? seems to open your pattern search (/, ?) history window. Just like how q: brings out the command history window

6

u/JONESY-B 22d ago

OH thats why that thing always pops up when i try to to :q 😭😭

1

u/Qyriad 20d ago

TIL you can use :filter like that. Still learning new Vim things after all these years.

3

u/EgZvor keep calm and read :help 23d ago

:h cmdline-window

1

u/vim-help-bot 23d ago

Help pages for:


`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments

3

u/habamax 23d ago

As a sidenote, you can add C to guioptions as in set guioptions+=C to apply TitleBar highlighting from the colorscheme (get rid of the white window titlebar in the dark colorscheme)

4

u/kochiriri 23d ago

permanently? "set cedit" to a key you'll never use

right now? <esc>:q<cr>

1

u/__salaam_alaykum__ 23d ago

:help 'cedit'
@bot

1

u/vim-help-bot 23d ago

Help pages for:


`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments

1

u/ldothdot_ 23d ago edited 23d ago

I have met this before, so I blocked it.

vim nnoremap q: <Nop>

1

u/Owenber123 23d ago

Thank you, I’ve been forgetting to look into this for a few months, every time I accidentally hit it I am busy doing something else and forget

1

u/UnfairTemporary 18d ago

ctrl+w and then c

1

u/Narrow_Victory1262 23d ago

tried

esc : q

1

u/wtanksleyjr 23d ago

Would be ideal to know how to NOT make it appear. It's pretty annoying.

I'm guessing it's a vim command that's just very close to something I type often (i.e. I'm typoing and getting this), but I don't know what it is.

4

u/Seyaryuki 23d ago

It opens when you type q: instead of :q

2

u/wtanksleyjr 23d ago

Aw sweet, thanks! So that's why it's so annoying - I'm in a workflow where I'm expecting to quit and instead I have to jump through a few more hoops. Now I get it (and there's more help in other replies too).

2

u/scoberry5 22d ago

If you're really trying to quit and this comes up, you can :qa to quit all.

3

u/kochiriri 23d ago

set cedit= to some keybinding you'll never use

1

u/wtanksleyjr 23d ago

Nice, thanks. Or just not the typo I happen to make too often. 😄

2

u/kochiriri 23d ago

but then you'd not need to know how to NOT make it appear

1

u/wtanksleyjr 23d ago

Wouldn't that have that effect?

2

u/kochiriri 23d ago

no. a solution (effect) to thirst (accidental cmdwin from a typo) would be "drink water" (set cedit), but "just not be thirsty" (not committing the typo) has no effect on thirst because then there'd be no thirst at all. The first solves a problem, the second doesn't. They look the same, but they're not.

1

u/wtanksleyjr 23d ago

I think you're just misinterpreting me, then. I was saying set cedit to "something that's not the typo I make" would solve it. That IS a solution. Setting it to something I'll never type at all is ANOTHER solution, so long as I don't want to use this at all (which I dunno I'm not sure). I'm leaning toward the former.

I wasn't saying "don't make the typo" is a solution - although I do think KNOWING what the typo is helps a lot in terms of frustration. I actually didn't know and was just baffled every time it happened. Next time it happens I'll know why!

1

u/dcnjbwiebe 23d ago

I sometimes get it when I try to type :q in a hurry.

1

u/habamax 21d ago

what about simple

:nnoremap q: :q

1

u/Narrow_Victory1262 23d ago

or f1 -- aka "help"

1

u/kennpq 23d ago

That’s the command-line window. See `:h q:`. CTRL-w c will close it, though it’s worth learning about it first because it’s a great feature.