We can get history for Ex commands and search with q: and q/ or q?.

What about history for normal mode command (e.g., s, yy, x, dw, etc.)? Am I stuck with :history?

  • 2
    It would be useful to explain what you are trying to do with this history maybe there is a workaround for your use case. There isn't really an history for normal mode commands but you can record all you keypresses when invoking vim with -w :h -w and you can redo the last normal mode command with the dot command :h .
    – statox
    Mar 23, 2021 at 13:48
  • Without more clarifications I think this is a duplicate of this question
    – statox
    Mar 23, 2021 at 13:49
  • 1
    The problem with using vim is that , accidental deletion of a large chunk of data happens under my nose.. and i was not aware of it. If i can map a button to check what command have i entered (when i got a feeling something might went wrong).. then i can prevent this kind of abhorable accidents. Apr 3, 2021 at 19:05
  • I've never seen this kind of issue tbh so maybe there is something wrong with your workflow that you'd need to fix instead of relying on a command history. Also are you aware of :h :earlier :h undo-redo and :h undo-tree maybe that would be useful?
    – statox
    Apr 6, 2021 at 7:43
  • @statox To clarify: I wish there is a history command list that i might know what have occured when i got a hunch something has gone wrong (i might have accidentally pressed some command that might have messed out my data in anyway). Do you ever look back when you walk forward ? to look back to see if you missed something which you got a hunch.. Apr 18, 2021 at 16:46


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.