Wednesday, December 9, 2009

VI - Macros

Abstracting repetitive steps of work in an on-the-fly macro is a task I find myself doing almost daily during development or database scripting. After hammering a pretty good one today, I was wondering to myself how to go about saving it. I did some Google searching ("save vi macro", "copy vi macro"), but came up empty. Then I realized that I already knew the answer. Whenever I record a new vi macro, I record to the q register. So I knew that my macro must be sitting as plain old text in the q register. So, I pasted the q register to my screen and lo and behold, there was my macro! I created a macros text file to track all my commonly used macros with descriptions of what they do. Yay!

No comments:

Post a Comment