4 ms·
I do wish they would do something about that loop where you hit 'q' and are recording a macro and escape won't work and you can't quit.
by Noumenon72 8y ago
I do wish they would do something about that loop where you hit 'q' and are recording a macro and escape won't work and you can't quit.
- megous 8y agoHit q again?
- AndrewOMartin 8y agoYou have two choices: 1) Learn what's going on, press q to start macro mode, and then press a letter to name your macro. Do stuff and when you're done press q again. You can then repeat that macro with @x where x is whatever letter you named your macro. @@ repeats it, and 74@x does it 74 times. It's (very occasionally) awesomely powerful. 2) echo "noremap q <nop>" >> ~/.vimrc
- dhimes 8y agoI find I use it for little things. For example, for html I have macros for <li> </li> and <p> </p> I also have one for commenting out a line in css I/*<esc>A*/<esc> Little things like that help me relax :)
- spapas82 8y agoFor commenting out I recommend installing tpope/vim-commentary. Then you'll just use gcc To comment out a line!
- bitofhope 8y agoCan't reproduce. Whacking Esc after q just cancels and :q (+variants) certainly seem to work while recording a macro.
- hultner 8y agoI think the problem is if you press q accidentally when you want to hit :q and then hit q again (recording @q), at this point Esc won't work and you have to hit q a third time to exit. When taking a second to think about it it's quite obvious but in the spur of the moment I sometimes get stuck hitting Esc multiple times before realising I'm in macro-recording mode and hit q to exit. I've also seen many new vi-users get confused when they accidentally enter macro recording. This could probably be improved with some clever hinting (maybe change hint to "recording @{key}, hit q to exit/stop recording") and maybe some hint when hitting q only once indicating that you're about to start a macro sequence.