1

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?

D. Ben Knoble
  • 26,070
  • 3
  • 29
  • 65
  • 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 '21 at 13:48
  • Without more clarifications I think this is a duplicate of this question – statox Mar 23 '21 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. – user15344508 Apr 03 '21 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 06 '21 at 07: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.. – user15344508 Apr 18 '21 at 16:46
  • The answer to your question is that such a thing doesn't exist in Vim/Neovim. Implementing it by yourself in vimscript will be not trivial and error prone, and implementing it in either of the projects will probably never be merged because it would introduce a lot of complexity for an added value which is not obvious. I think your best bet is to get used to undo/redo things and you'll see that it doesn't happen often that you do something without realizing. – statox Apr 19 '21 at 08:11

0 Answers0