5 ms·
My main gripe with modal editors is that they still use the Escape key to go back to normal mode even though Escape was chosen for historical reasons (used to s
by cassepipe 7mo ago
My main gripe with modal editors is that they still use the Escape key to go back to normal mode even though Escape was chosen for historical reasons (used to sit much much closer to the home row on older Unix Keyboards)
In Linux and MacOs I can change it with just one gui setting but it's still annoying how everyone went with it. It's not mentionned in most vim tutorials. According to a vim reddit poll, at least half of the users are just using Escape where it is now instead of one of the alternatives. This is beyond me, it feels like someone inventing glasses in order to see better but everyone settled on cast iron frames.
- andrewl 7mo agoCassepipe, it’s not a great default for sure. What do you have yours mapped to? I mapped jj to return to normal mode and also save my file. So, as I’m typing, I just hit jj, the jj vanishes, and this command is run: <Esc>:w<CR> I could just have it escape instead without saving. If I hadn’t chose jj it would have been ff, which is also always under an index finger. I do wish I’d been clued into the idea when I started with Vim instead of two years later.
- cassepipe 7mo agoI find the jj/jk hack a bit too clever for my taste. I just map CapsLock to Escape system-wide because it also unlocks quick escaping for shells vi-modes too and I realized that actually Escape is a really nice key to have around in a lot of UIs to get out/go back/cancel what you are doing. I also like that it's a simple gui setting away (or registry key editing in windows). I either put CapsLock where Escape sits or use both shifts simultaneously (one cancels it) but even then I almost never use it. The rare times I need to type a lot of uppercase together is generally code in vim and visual selection + gU does the job. The point of my comment was not to shill for a particular solution though but for the vim community to acknowledge the problem publicly instead of it being some insider knowledge you discover in a random internet comment six months into fighting vim (if you haven't dropped out yet)
- zargon 7mo agoWhat key would be a good candidate as a default though? Imagine the memes for exiting vim if you needed a modifier to get into normal mode. Caps lock is truly a useless key and should be escape anyway.
- dunham 7mo agoAs someone who cut their teeth on a sun "programmer" layout, I really need control to be in that position. I might try mapping the vestigial control key to escape though. Or maybe the hack that dtj1123 describes (tap is escape, hold is control), if I can pull that off on macos.
- sodapopcan 7mo ago<ctrl-[> always works out of the box which is less of a stretch than esc. I do jk as I always find a roll easier on the fingers than a double-tap jj or kk. You could also use space provided you aren't using one of those distros that bases its identity on the spacebar.
- gigatexal 7mo agoYea for me capslock is a systemwide esc for me. Works great.
- arbitrandomuser 7mo agodoesnt it get annoying when you actually have to type two adjacent j ?
- dtj1123 7mo agoI have caps remapped to esc when tapped, and ctrl when held. Takes perhaps a weekend to get used to, but once the muscle memory is there it feels incredibly comfortable and natural.
- dev-ns8 7mo agoIs this macro mapped in vim or OS level? Sounds interesting.
- cassepipe 7mo agoLast time I checked, on all OSes you need to install some third-party software alas. Hopefully I am wrong now.
- deleted 7mo ago[deleted]
- CorrectHorseBat 7mo agoI configure it in the firmware of my keyboard with QMK
- dtj1123 7mo agoI believe it's done via a daemon that intercepts keystrokes
- cassepipe 7mo agoI have hesitated many times to set this up but I don't want to get used to something that I cannot set up in less than 30 seconds on a new machine. Not having Escape where CapsLock sits on a new machine already makes it infuriatingly unusable already :)
- gpvos 7mo agoWhich tool can do that kind of wizardry? I've seen either but not both.
- sodapopcan 7mo agoI mean... if people don't mind reaching, so what? I purposefully don't remap my leader key, although I don't have many leader mappings so it's not like I'm reaching for it constantly.
- cassepipe 7mo agoI mean if people don't mind having cast iron glasses, sure No but really, vim's paradim that you should go back to normal mode constantly. With the current situation you get posts on the vim subreddit asking/telling you about insert mode editing commands. You might as well use Emacs at that point, at least it would be the intended workflow
- sodapopcan 7mo agoAh so you're saying people would probably not ask these question if exiting insert mode had a more accessible key?
- cassepipe 7mo agoExactly
- sodapopcan 7mo agoPossibly, though would have to see data, I guess. I feel like a lot of people are just curious about Vim and spend all their time in insert mode anyway. I have seen a bunch of those questions around "how would I do this without exiting insert mode" questions, though I'm not sure that having a more accessible escape key would change all of their minds. The "I want to use this new thing but I'm only interested in using it in a way that I'm used to" mindset is rampant among programmers.
- paddim8 7mo agoIt is not good for your wrists. Don't do that to yourself
- grayrest 7mo agoI map caps to ctrl and do ctrl-[ to get to normal mode. The main reason is using Vim bindings in other editors where Esc can get intercepted by other bindings but ctrl-[ has always worked everywhere.
- cassepipe 7mo agoMy opinion is that going back to normal mode is too important a key to be a key combo, and a weird one at that (is it [ or ] ?). I am pretty sure you can get used to it but we humans get used to anything really, doesn't make it good. My pressing on CapsLock happens at a subconscious level. Quick edit and then punctuate with CapsLock with the pinkie. Some random key combo is not acceptable. But again my point is that the default sucks. You probably learned a about Ctrl + [ while looking online for alternatives after realizing the default sucked
- zem 7mo agoat least on linux you can map caps lock to esc if tapped and ctrl if held
- cassepipe 7mo agonatively ? how ?
- zem 7mo agohttps://www.dannyguo.com/blog/remap-caps-lock-to-escape-and-control https://www.dannyguo.com/blog/remap-caps-lock-to-escape-and-... has a good run down of the ways to do this.
- cassepipe 7mo agoBut you do have to install and configure xcape. By native I meant something that would either be an gui option on your DE or a simple command from something that is already installed on a linux distro like `setxkbmap`