tags:

views:

283

answers:

4

Is there a somewhat orthodox way to enter ex mode faster, like with a single key stroke, instead of hitting shift-; for ':'? Why was that character ever chosen for such a frequently accessed mode? Often enough to be annoying I'll accidentally miss the shift key, start typing an ex command, and find I have a lot to undo. Thanks for your suggestions. :)

+9  A: 

Set up your own mapping. e.g.

nmap <Space> :

Now spacebar in Normal mode takes you to the command line. However personally I don't find : hard to type. You get used to it after a few months of Vimming.

Brian Carper
This appears to be the best solution -- I guess I don't want to get too used to another method besides ':', I just wish another character were chosen, lol ;)
CMB
+4  A: 

rather than making a quick macro just to enter : you might want to automate whatever you're rushing to do all the time. Little tricks like this add up.

I find double slash as an easy leader. (a lot of plugins map single \ )

eg I have

nnoremap \\t :vert stag <-- opens tag of current word in vertical window

nnoremap \\g :vimgrep */ <-- searches code tree for word under cursor

nnoremap \\w :w

etc

michael
Following your suggestion, I created the following mapping, and will add more for frequent things I do:nnoremap ;w :w<CR>Thanks.
CMB
The only problem with mapping ; is it already has some handy functionality for left and right motions you will eventually learn. Check out :he f and read down. Reading :he map-which-keys suggests , and _ Come to think of it I have a ,w mapping I created and never use :)
michael
+1  A: 

Typing ':' doesn't put you into ex mode, it puts you into command mode. I'm not sure if this is a default keybinding, but "Q" puts me into ex mode.

As for a faster way of getting into command mode, it doesn't get much faster than a single keystroke. I would recommend just taking a little bit of time to get used to it.

Bryan Alves
Right. This is confusing terminology in Vim. In Command Line mode you can run Ex commands but you aren't in Ex mode.
Brian Carper
You're right, I meant command mode. Sorry 'bout that.
CMB
+1  A: 

I switched the semicolon character with the colon character.

noremap : ;

noremap ; :

So now, to enter Command mode, I just press ; (no Shift) and do : (Shift + ;) for reapeating forward a f or t search.