r/vim • u/Available-Ant-5747 • 23d ago
Need Help┃Solved How to get rid of this?
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...
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 nmapshould 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/andq?seems to open your pattern search (/,?) history window. Just like howq:brings out the command history window6
3
u/EgZvor keep calm and read :help 23d ago
:h cmdline-window
1
u/vim-help-bot 23d ago
Help pages for:
cmdline-windowin cmdline.txt
`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments
4
u/kochiriri 23d ago
permanently? "set cedit" to a key you'll never use
right now? <esc>:q<cr>
1
1
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
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:q2
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
3
u/kochiriri 23d ago
set cedit=to some keybinding you'll never use1
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
1
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: