Show pressed keys in VIM normal mode statusline

ezuk picture ezuk · May 3, 2011 · Viewed 9.8k times · Source

I use VIM, the Colemak keyboard layout, and a Microsoft Natural 4000 keyboard. Since the Natural 4000 has differently-shaped keys, I could not change the keycaps. This means each key is labeled with an "incorrect" key -- I press the key that says "O" and it types "Y".

That's fine in normal use, because I touch-type smoothly with Colemak and don't make many typos. But with VIM it presents a bit of a problem, because I often need to hit a key "out of sequence" -- i.e, just suddenly hit "g" without any context. For some reason that's harder to do, and I keep hitting the wrong keys.

I'd like to be able to hit a prefix key (say, the leader key twice -- \) and then have any further keys I hit within 1-2 seconds shown on the status line.

This way, I could quickly hit \ and then tap a key or two, and see what key it "really" is.

Any ideas how I could make that happen?

Answer

Prince Goulash picture Prince Goulash · May 3, 2011

Try set this

:set showcmd

It displays your keystrokes in statusline as you enter them, without any need for a prefix key.

you can also turn it off by using below command in normal mode of vim (pressing Esc key).

:set noshowcmd