Vim “show my last command” command?

前端 未结 5 1906
小鲜肉
小鲜肉 2020-12-12 18:44

Is there a command which shows what was the last command in normal mode?

Suppose I accidently hit random key and got some unexpected result. Sure I can undo it, but

5条回答
  •  悲哀的现实
    2020-12-12 19:32

    The text from the last command is stored in the . register. You can see all registers by :display. Unfortunately it doesn't say what the started the normal command.

    To see commands from : (command mode) you can use :hist or q: which is limited to the last 20 (by default).

    Another ability is to save the undo buffer :wundo undo.bin -- but the undo buffer is binary.

    But none of these actually answer your question. I'm curious if it can be done.

提交回复
热议问题