Today I discovered these two Vim flags:
vim -w log.txt file
vim -s log.txt file
The -w flag sends all keystrokes in your session to log.txt. The -s loads
Vim and replays all the keystroke back onto that file.
So I open file, type lll and :wq, and then my log.txt should have some
representation of that saved. When I open file again with log.txt as my
script, those same keystrokes will replay after the file opens. The arguments
are scriptout and scriptin, respectively.
This seems like a massive discovery and I’m not sure what the practical applications could be. For now, I’m saving my keystrokes to a local file for analysis.
See man vim for more info.