0

I have a last command in vim which can be replicated by the 'dot' operator. However, I now wish to execute another operation, and then go back and execute the previous command. When I execute my new command, the 'dot' operator will get overriden to the new command. How can I copy the contents of the 'dot' operator to a register to execute it later?

Or, is there another vim operation which achieves this more naturally?

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
piedpiper
  • 1,222
  • 3
  • 14
  • 27
  • https://vi.stackexchange.com/ – Rob Aug 18 '21 at 13:45
  • 2
    https://stackoverflow.com/a/17963115/7976758: "*Unfortunately, there's no way to get and replay the command behind the `.` command. The only workaround is to be perpetually in macro recording mode, and use the macro register as a replacement for the `.` command.*" — @Ingo-Karkat. Found in https://stackoverflow.com/search?q=%5Bvim%5D+dot+command – phd Aug 18 '21 at 13:52
  • 2
    What command is executed by `.` is not exposed to the user in any way so what you want can't be done. The alternative is to be more mindful about what you are doing and rely on the explicitness of recording rather than on the implicitness of `.`. – romainl Aug 18 '21 at 13:52
  • Does this answer your question? [Vim Repeat dot (".") command buffer?](https://stackoverflow.com/questions/17960146/vim-repeat-dot-command-buffer) – Enlico Aug 23 '21 at 09:58

0 Answers0