4 ms·
Many of them fail to implement macros in my experience. Though I've heard VSCode got this part right. The most productive vim keybinding I ever came across wa
by JackCh 8y ago
Many of them fail to implement macros in my experience. Though I've heard VSCode got this part right.
The most productive vim keybinding I ever came across was:
noremap <Space> @q
Since the key to start a macro is q, you can quickly tap qq to record a macro to the q register (end it by pressing q again.) Then by whacking the space bar you can execute the q macro as many times as you'd like. Once you get into the rhythm of using it often even for small tasks, it can become a great optimization. Sometimes I use it with five or more different macros in a single minute. If you ever look forward in time and see that you're about to perform the same edit two or three times, pressing the q key three times total and the space bar once per execution (or only once with a count) will often be fewer keystrokes than had you performed the edit manually each time. Not to mention triumphantly smacking the space bar to repeat an edit is a great feeling.
(Simple edits can be repeated using . which is another indispensable vim feature that sometimes gets missed by vi-plugins in other editors.)
- sodapopcan 8y agoSince <space> is some peoples' leader key (not mine, but I see it a lot), just throwing it out there that `Q` is a fine alternative for that mapping too. It's also a nice semantic companion to `qq`! ...unless you are a heavy ex-mode user, of course :)