4 ms·
I usually record my throwaway macros to q (because hitting qq is so easy), so I've bound Q to 'call the most recently defined macro'. I would post something to
by Expez 12y ago
I usually record my throwaway macros to q (because hitting qq is so easy), so I've bound Q to 'call the most recently defined macro'. I would post something to put in your .vimrc, but I use the vim emulator evil-mode in Emacs.
This way, I can skip the awkward @q step, and keep hitting Q instead of @@ to re-run the macro.
- untothebreach 12y agothat is a great idea!
- burke 12y agoI use <space> for this. It's very gratifying, mashing the spacebar to repeat a macro.
- weaksauce 12y agousing space for the leader is one thing that I absolutely love... I was using , for it but space is so much easier and nicer to use. you are not limited to one finger to start the leader command so it makes both sides of the keyboard nice to use for leader chords. it only took about a week to retrain myself for it. here's the command... put it at the top of your vimrc before anything else so it works with your plugins. let mapleader=" "
- burke 12y agoHm, this is actually a really neat idea. I'm going to try this!
- weaksauce 12y agoIt was painful for a few days but after that I can't imagine going back to , especially since that is actually a useful default binding.
- sstanfie 12y agoI have mapleader set to ",", which has served me well. I just realized I only use my left thumb with the spacebar, so the ambidextrous argument doesn't fly for me. But I did realize space currently does nothing for me in normal mode. So I made it work like less/more, i.e., it pages the screen down: nnoremap <space> <C-d> nnoremap <S-space> <C-u>
- sstanfie 12y agoShould just be: nnoremap <space> <C-d> The shift-space doesn't work.
- weaksauce 12y agoeven if you only use your left thumb to hit space it's still faster than using , for your leader as the thumb really only hits the space key, command(if you are on a mac)/alt(windows) and maybe option/alt if you are on a mac. and it's natural to use the left keys after hitting space. whereas using any key on the right side of the keyboard after a leader press is awkward and slower because the , key is pressed with your middle finger. it's also a smaller target so it's harder to hit.
- randy909 12y agoSee space.vim for another cool use for the spacebar. https://github.com/spiiph/vim-space https://github.com/spiiph/vim-space
- forwardslash 12y agoHow do you call the most recently defined macro? I just have Q bound to @q, but if I could make it more general that would be awesome.
- davis 12y ago@@ re-runs the last macro.