When using vim, sometimes I end up in a state where entered commands (ones which are preceded by a : colon) are put in some kind of secondary buffer instead of being executed, and I have to exit from this mode first (by using :q?) to be able to return to editing of the original file. Sometimes all my previous input ends up pasted in the file I was editing.
I don’t know why this feature is here, but I’m pretty sure I never need it, so is there a way to turn it completely so that it will never happen? I just need this third mode ever.
Here is Solutions:
We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.
There are two ways you may be accidentally brining up the command-line window. One is you are already in :-command line and accidentally press
<c-f>. The other is you are accidentally typing
q: in normal mode.
To disable the first:
:cnoremap <c-f> <nop>
To disable the second:
:nnoremap q: <nop>
Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂