Vim Tip: Command History Buffer

After numerous accidental invocations of the following tip, I finally figured out what I was doing and now find it very useful.

To open a browsable and selectable list of your Vim command history (commands entered via :<some command here>), just press q:. Of course, :q is to quit but the reverse gives you a nice way to sift through, and invoke, previous commands.

Screenshot:

Command History Buffer

Hitting <enter>, with your cursor on one of the lines, will invoke that command. Hitting <enter> on the blank line at the bottom will close the buffer and take no further action.

This history is, for the most part, a normal buffer and can be interacted with as such. For example, closed with :q or resized with <Ctrl+W>+.

Also, usevim is a phenomenal blog for Vim tips, tutorials, plugins, and scripts.

input
Comments