Do macro commands deserve to be on 'q' key?


#1

Kakoune has the following macro normal commands:

  • Q start recording macro
  • q play macro

In my workflow, I observe that I hardly ever use macros thanks to multi-selections. Nevertheless they waste by default a place of choice on the keyboard! This is mainly explained by the vim lineage where the q key is also used to replay macro.

Of course, every user is free to remap them somewhere else and use the q to perform whatever actions they need.

Do you remap the q to something else? Do you think macro commands should be move to another key by default?


#2

It might be due to MY vim heritage, but I use macros relatively often in Kakoune. Might be because my multi-selection chops aren’t good enough yet. Also, I kinda like that it rots because I use alt-q to switch panes in tmux. ducks


#3

I also never use macros. In the rare cases that multi-selections don’t cut it, I tend to just type out the exec sequence, I find that less error-prone than recording a macro.

One problem with remapping q/Q is that you cannot do :exec Q to record a macro, probably due to some context cleanup. I guess I should report it.


#4

I think macro earned it’s place on keyboard because it’s pretty powerful command. I don’t use it as often as in Vim. I see two common use-cases in my workflow:

  • irregular code that is hard to select all at once. I record rough edit and then tweak manually case by case. Example: converting function signatures from C header to Crystal bindings.
  • working with incremental changes. Example - writing markdown document. If I paste a lot of URLs, I record macro that converts URL under cursor to markdown link. I could do this at the end but have to write link description manually anyway.
  • there is also golfing… :laughing: