Hacker News new | ask | show | jobs
by tyleo 3566 days ago
I am a Vim user. Mapping Caps Lock to Esc has been pretty valuable and it only took me about a week to get used to the change.
2 comments

Have you tried the jk chord? for me, it feels faster because the j key is where my right index finger parks.

:inoremap jk <esc> http://learnvimscriptthehardway.stevelosh.com/chapters/10.ht...

I love the jk chord. No more escape reach for me and vi gets even more vi-nature as the fingers stay where they belong.

I even remap ESC to nop so that I won't ever forget.

Oh, you mean hitting j and k in sequence, not an actual chord.

Is there a way to make it trigger when pressing both keys at the same time? I'd rather not have a letter sequence that can kick me out of insert mode, especially when I'm pasting into my terminal.

No; there's absolutely no way for vim (terminal vim at least, but gvim inherits lots of terminal quirks) to see a chord like that.

But, never fear -- if you paste while in paste mode (:h 'paste or :h 'pastetoggle) imaps, iabbrs, etc. do not get activated. If you paste when not in paste mode then things tend to get messed up anyway and those are probably the least of your worries.

Or paste using the clipboard -- "+p in normal mode, or <c-r>+ in insert mode. (The other clipboard is in the asterisk register, but HN keeps eating the character)

I think you can use Ctrl+C or Ctrl+[ instead of Esc?