Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute vim macro step by step (like debugging)?

Sometimes when my vim macros become too long, there are small mistakes. But without being able to execute the macro step by step, it's really hard to find the problem.

Is there a possibility to step through vim macros or debug them in any way?

like image 941
miu Avatar asked Aug 14 '14 21:08

miu


1 Answers

If you want to look at the contents of a macro you can use :reg a where a is the register you stored your macro in.

Then you can paste the contents of the register with "ap where a is the register name. Once you have done this you can change the line to suit your liking. Finally you can bring turn it back into a macro by using "ayy where a is the register name.

like image 92
Zach Avatar answered Sep 28 '22 07:09

Zach