Tip: #314 - Insert and back
Created: August 14, 2002 16:29 Complexity: intermediate Author: Alex A. Naanou Version: 5.7 Karma: 13/10 Imported from: Tip#314
this is related to VimTip289 in terms of programmers (like I) too lazy to move their hands to reach the far far away <esc> key.... joking! :)
actually the less your hands move around the faster you type, and the fester you type the more time you have on your hands to think of "what" you type...
here is a small snippet from my mappings file, ready to speed things up:
// the key overloading might be a somewhat confusing at first....
--cut---
imap <S-Space> <esc>l
imap <C-CR> <esc>o
imap <S-CR> <esc>O
nmap <S-Space> i
nmap <space><space> i
nnoremap <CR> o
nmap <S-CR> O
---uncut---
Good luck!!
Comments
I would rather extend my pinky quickly to <ESC> than pressing two keys at the same time. What is wrong with <ESC> key ? By trying to press <SHIFT> "and" <SPACE> at the same time, your whole hand is already moved downward, which actually delays the process. I think that you are not a touch typist, in which case this is not bothering at all. However, for the touch typist, moving the whole hand is the most annoying thing. By pressing <ESC> alone with your pinkie, you don't need to move your whole hand, and get back to the your typing very quickly without looking at the keyboard.
viking--AT--vi.king.net
, August 16, 2002 7:54
I personally rest my hands on the keyboard, so as to have my forefingers relaxed on "f" and "j", my thumbs on "<space>", pinkys on "<Caps>" and " ' ", and the middle fingers touching the "number keys". so I reach all the keys without lifting or moving either hand. all but the function keys and <esc> to get to which I have to lift the whole arm, and that turns into a problem as the escape key gets pressed almost as often as the shift key. so what was proposed by Jeffrey Lim in VimTip289 was quite natural for me, all but the double <S-Space> which I find a bit slow...
which mappings work for you an which don't, depends on how you hold your hands, your typing style and maybe you keyboard, and that is your choice to make...
Best Regards... Alex.
Alex A. Naanou <alex_nanou--AT--yahoo.com> , August 16, 2002 16:19
I personally found mapping <esc> key to a double pressing "J" while in insert mode faster and very convinient.
imap jj <esc>
give it a try, by
enviameloa--AT--hotmail.com , August 17, 2002 13:11
mapping jj to ESC... What an excellent idea ! There is no occasion to type jj in any situation, so jj should be just fine. Yes, it should be much faster. But I still need to make it as my habit. Still, because of my habit, extending my pinkie to ESC is faster at this moment. Thanks a lot ! :-)
viking--AT--vi.king.net , August 21, 2002 9:40
Cool!! I think this one is worth the adaptation period!! :)
pressing one button in the middle of the keyboard twice is a lot more intuitive than <S-Space>, and may be quite a speedup if you spend the time to get used to it.....
Thanks!!
Alex A. Naanou <alex_nanou--AT--yahoo.com> , August 21, 2002 17:24
Ya jj is good. I'm used to <M-j>
nithin_sujir--AT--yahoo.com , September 13, 2002 17:47
> There is no occasion to type jj in any situation,
Yeah, except when you're trying to add it to your .vimrc file. ;)
Great idea.
jamesb--AT--panmatrix.net , October 19, 2002 15:13
Of course, if you ever DO need to actually type j twice, you can wait a half second or so between them (until the cursor moves).
Though Idunno if I could ever get used to something like this. the escape key isn't that far away. ;)
rando--AT--babblica.net , November 6, 2002 4:42
Hi ! I got used to work with the US keyboard layout (much better for programming : easy access to ;:/.?\"]}[{<>) instead of the swiss-french one. I found the idea of jj great, but decided to use jk (faster, two muscles driven, fun).
impa jk <Esc>
ps : more over, jk makes joke if you try to say it, and that's very cool.
dev--AT--gaspardbuma.org , June 10, 2003 0:41
sorry for the misstyping : imap jk <Esc>
dev--AT--gaspardbuma.org , June 10, 2003 0:43
Hey, I seemed to type the imap thing just as you said but it doesn't seem to work. I typed imap jj <Esc> in my .vimrc file but when i'm insert mode it just gives me a bunch of jj's. Is it just me?
Chad
fatboyco93--AT--hotmail.com , February 6, 2004 2:18