In nvi, I just key my commands on a scratch line (testing occasionally), then:
“xyy
[0] https://vim.fandom.com/wiki/Macros