12 ms·
For those who, like me, had never heard of Ex-mode: https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Modes#Ex-mode https://en.wikibooks.org/wiki/Learnin
by epmatsw 12y ago
For those who, like me, had never heard of Ex-mode:
https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Modes#Ex-mode https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Mod...
- octo_t 12y agoaka "Oh, that's the key I have been hitting by accident"
- untothebreach 12y agoYea, I finally got fed up one day and put nnoremap Q <nop> in my .vimrc. No more "how did I get HERE?"
- adolfoabegg 12y agooh man, thank you very much!
- untothebreach 12y agoNo problem :)
- Expez 12y agoI 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>
- 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.
- BruceIV 12y agoThis is wonderful, I must do this, I keep hitting `q` instead of `:q` when I want to quit Vim, and it's a pain to get out of...
- return0 12y agoAnd for those who are still stuck in it ... :vi to end the madness
- unclebunkers 12y agoexit also works.
- icambron 12y agoThe instructions tell me to type "visual" and that seems to work.
- deleted 12y ago[deleted]
- k__ 12y ago"... similar to the command line mode ... Unlike the command-line mode you won't return to normal mode automatically ... enter ... by typing a Q in normal mode" So they have a mode you enter when pressing q (which quits many other programs) that you can't leave if you don't know the leave command? This is comedy gold. :D
- icebraining 12y agoIt was in fact the original mode. vi was the visual mode for ex.
- seszett 12y agoNot "q", but "Q". Actually, when entering Ex mode you get a little helpful message that says Type "visual" to go to Normal mode. If you do press "q" though, you're in macro mode, and you don't get any helpful message that tells you that you have to press "q" another time to exit it.
- k__ 12y agoI see, thanks for the clarification :) Vim always seems like magic to me. I always use nano/pico when I need to edit something in the command line.
- cwyers 12y agoYeah, I remember when I was first learning Linux, I was pretty much thrown into the deep end with nobody to help me much. I got into vim to edit a text file, and was... completely lost at sea. I figured out how to install nano and have never touched another Linux text editor since.
- sejje 12y agoVim is a programmer's dream. If my only use were editing files in CLI, though, I'd have always used nano and not learned vim, as well.
- 12y ago