Here's something I noticed today when using evil macros.
In vim, when you record a macro, you do it specifying a register where you want it to be stored. And registers are used for both copying/pasting text and storing macros (it stores the keypresses, so it's all text!).
On the other hand, a nice thing about emacs macros is that you can fine tune a macro in a very user-friendly way with kmacro-edit-macro.
Evil macros are a kind of hybrid between the two, and stored in an evil register and also as an emacs macro, so kmacro-edit-macro will give you the last macro you created, even if you created it with evil. The "problem" is that it doesn't update the evil register, so once the macro is defined for the first time, both macros (emacs kmacro and the evil register) are completely detached, and modifying one, does not modify the other.
I guess this is the right thing to do, because entangling one with the other could have many unexpected effects.
Along this experimentation, It's worth noting that editing the macro "the vim way" works great. kudos to evil devs again.
So given we have stored the evil macro in register 'q':
- "qp to paste the register q.
- edit the line - select the characters of the macro.
- "qy
- @q
No hay comentarios:
Publicar un comentario