4 ms·
Are you familiar with vim q macros? It's a similar thing but you don't need to use maps/remaps to use them: q<letter> to start recording and q (in normal mode,
by WorldMaker 4y ago
Are you familiar with vim q macros? It's a similar thing but you don't need to use maps/remaps to use them: q<letter> to start recording and q (in normal mode, so <Esc>q sometimes) to stop recording. Then you can rerun the macro with @<letter> (or @@ is rerun the last macro). (Even fun things like <count>@<letter> work to rerun the macro a number of times.)
VSCodeVim seems to support q-macros just fine. The lone silly missing bit is that VSCodeVim makes it slightly tougher to save/reuse q-macros than proper Vim [1]. In Vim those letters are the exact same "registers" as copy/paste so that you can record a macro to register 'a' with `qa…<Esc>q` and then if you want to save that macro for later you can just paste it into a document somewhere `"a` (paste register a) and pull the macro back in with the right motion and yank to the register you want (`<motion>ya`). VSCodeVim unfortunately uses separate registers for now and it is a bit more work to save/restore q-macros.
[1] https://github.com/VSCodeVim/Vim/issues/1658 https://github.com/VSCodeVim/Vim/issues/1658
- bee_rider 4y agoI should get used to q macros, they are the right way to do what I like to do. Unfortunately before hearing about them I mapped qq to 'quit' and I'm afraid the muscle memory is just stuck there now.
- WorldMaker 4y agoWhen I was a novice first starting vim I was given great advice that I followed for many years: avoid custom mappings. It's tough to learn vim if you confuse its mappings. When I was an intermediate user of vim for several years I had drastically custom mappings because I thought I knew enough and knew better. I thought I had a good excuse, too: I was using a different keyboard layout and I might as well remap everything. As an aged user of vim, I can't call myself "advanced" or an "expert" user I don't think, I've returned to the wisdom of the sages: avoid custom mappings. I still need some moderate remappings for my keyboard layout but have come back around to "the less I remap, the better".