Just wondering is there a way to record macros (similar to vim) and replay them really quickly. I often use this to do batch processing for files, and evil is really slow due to slow rendering after each macro operation.
Yes you can do that in Emacs of course. Default key bindings are "C-x (" to start recording, "C-x )" to stop, and "C-x e" to play the macro — and then you can just press "e" to repeat it again and again.
This is one of the feature that I miss the most when I'm using another editor. So much that I spent some time this summer implementing keyboard macros in Kate, which is also a very nice text editor :). See https://news.ycombinator.com/item?id=32585221
> and then you can just press "e" to repeat it again and again.
You can also pass C-x e a 0-prefix argument (M-0 C-x e) and it will repeat the macro until the bell rings, which usually happens when a movement command like forward-line, forward-sexp, etc. reaches the end of a buffer.
Another strategy is to record a macro that only operates on a single line, then mark the region you want to repeat it in for every line and then execute it on all these lines using C-x C-k r.
Since parent is using evil, they can just use q as in Vim (evil-record-macro) in place of kmacro. But the "rendering issues" would presumably apply either way.
There's a painfully simple answer to this. Use evil-mode, and then just make your macro exactly as you would in vim. You can have the best of both worlds and it mystifies me when not everyone does this. (No accounting for taste etc.)
Imagine everyone around you argued about it was better to wear socks or to wear shoes, and you just have to wonder why they don't try doing both at once?
Now I wonder if there are people who use Emacs controls in vim and wear their socks outside their shoes.
This is one of the feature that I miss the most when I'm using another editor. So much that I spent some time this summer implementing keyboard macros in Kate, which is also a very nice text editor :). See https://news.ycombinator.com/item?id=32585221