inoremap jk <esc>
inoremap kj <esc>
home row escape key that is faster than jj (which i used for a long time) as you can just mash both keys at the same time and it will get you out of insert mode. Has the benefit of being a nop in normal mode too.
well fd and df are both default commands(find the letter d and delete find next character in normal mode) so I don’t have them bound to anything other than the normal find and delete in normal and in insert mode they are just insert f and d separately.
I just realized you can search tags and commit histories with fzf in vim.. (:Tags and :Commits) Very cool.
I like the idea of this - especially for apps where rails is implemented more as an api server. I’ll be wanting to take a look at this asap. The fact that this is possible really highlights, IMO, that the the client and server can and should be neatly decoupled.
[Comment removed by author]
I’ve been doing that of late by adding another repo… and a csrf exception. I guess I interpreted this as a move by rails to decouple and play a bit better with front-end frameworks. We’ll see! I’m with you though in that I’m kind of liking separate repos for front and back ends
There is, of course, the ever classic alternative: Caps Lock! Specifically, rebinding Caps Lock to Escape, or have it pull double-duty as both a control key and escape.
I used to use seil and karibiner on a mac to dual map caps lock - hold for ctrl, tap for esc - but those stopped working in Sierra.
Has anyone got those working?
I haven’t upgraded to Sierra yet, but Karabiner Elements may work although a “double setup” for a key may not be supported. Am curious to hear how you get on.
All the current solutions are hacky and haven’t worked very well.
I just map it to Ctrl and make Crtl-] my new Escape key.
Mind sharing your configuration? I don’t see a preset for that behaviour in Karabiner or Seil. (And I’m still using El Capitan :)
See here.
You can remap caps lock to escape directly in the settings in Sierra, no need for third party extensions.
That works pretty well, but I prefer to Control on Caps (with Backspace on left control, and Caps moved across to Backspace). Makes both chord-ing and editing easier in general. Still haven’t found a good place for Escape instead. Maybe switch with tilde? Just close enough to reach without moving my entire hand, far enough away to not knock?
There’s a little program called xcape that does this.
I like using inoremap jk <Esc> instead of inoremap jj <Esc>. It’s quicker to hit two keys in quick succession and it has the benefit of being mostly being a no-op in normal mode since you just go down a line and then up a line; which is nice if you have a nervous habit of returning to normal mode even though you might already be in it.
I am a big fan of using jk, and like you have never run into any issues where I need to type “jk” in insert mode. I recently switched to spacemacs, where they introduce a default of “fd” which I have found similarly ergonomic.
So doing that would cause typing ‘jk’ in insert mode to return you to normal mode? What would happen if you actually wanted to type ‘jk’?
In three years that I’ve used jk, it’s never been an issue.
That would change when someone invents texting integration into vim.
You need a small delay so that the chord doesn’t register, it’s about one second. So you type j, wait a second, then k.
Hasn’t ever happened to me either. If it did, you would just have to hit j, then wait a second for the multi-key timeout to expire and the j to actually appear, then hit k.
Me too! IMO, jj just doesn’t feel right… It will probably become more of a habit when I start using a new mbp.
some people remap jk and kj to esc so all you need to do is press both j and k at the same time to get esc. I am too used to jj to do that but you might want to try that.
It was mentioned at Seattle Lean Coffee by one of the participants there. :)
I stumbled across this video (and demo) and was hoping there’d be more of a thread here on lobste.rs.
I’d highly recommend viewing! I particularly appreciated the visualization of showing blocks of different sizes. I was somehow caught up on the idea that blocks needed to be the same size. Now I can better appreciate the idea of timed block releases.