Does anyone make use of macros?

Just curious what everyone’s experience is. I came from a couple years of using vim, where I had gotten used to using macros to repeat complicated edits on multiple lines. However, with kakoune’s powerful multiple selections, I find that same use case is handily covered, and a lot more interactive and easy to get right. To date I have not had any reason to press q in normal mode in Kakoune.

Macros are useful for irregular code or when I know I will need to repeat something later or on multiple buffers.

Another nice use-case: when I create custom plugins/command instead of writing execute-keys sequences manually I record a macro and insert key sequence to my script with ctrlr@


I also use macros when I want to pause my brain: instead of doing a complex change on a large region, I record a macro for a tiny portion where I’m sure it works, and repeat in multiple places to observe the changes.

If you ever need to edit a macro, you can do:

  1. :set-register a '<c-r>@, edit and validate,
  2. Q"aq, and continue recording.
1 Like

This Pull Request can help a bit while creating macros:

1 Like