If I am in vim normal mode and I type q:
a quick-fix window pops up with a history of recent commands.
I'm stumped at how this works, q
is for recording macros, is it unexpected behaviour because the :
is not a register?
I looked in :help q
but couldn't see anything that made sense there.
If you follow :help ":
, you'll see that register :
is a read-only register. Recording a macro into it is not possible. Therefore, there's no clash with macro recording.
The q:
command enters the command-line-window; yes, this is similar in appearance (and also somewhat in behavior) to quickfix windows. You'll find it documented at :help q:
, or :help cmdline-window
.
q: in normal mode results in displaying the command line history
A history is maintained of ex commands, searches, expressions input lines and debugging mode commands.
The normal command, q:
, puts you in the ex command history where you edit your command history. It has similarities to the ex command, :history
.
The following help articles discuss this:
:help cmdline-history
:help cmdline-window
There is a lot of value in being able to review these histories.
Ingo addresses your questions pertaining to registers and clashing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With