6 ms·
Meanwhile, the Escape key on popular keyboards is getting smaller and smaller :(
by amelius 9y ago
Meanwhile, the Escape key on popular keyboards is getting smaller and smaller :(
- platinumrad 9y agoYou can rebind caps lock to escape.
- tetraodonpuffer 9y agoor rebind it to ctrl if held, escape if tapped, making it even better for RSI purposes
- amelius 9y agoThat's a good one!
- mkl 9y agoWhat do you use to do this? On what operating systems?
- farresito 9y agoIf you are on Linux, try xcape; on Windows, you can do it with autohotkey.
- fencepost 9y agoRemapping CapsLock to Ctrl on Windows is easy with KeyTweak (what I have is 2.3.0 by Travis Krumsick), though I had to select the CapsLock key from the displayed keyboard rather than simply hitting the key. All it appears to be doing is updating the Registry's key mapping values based on the keyboard scan codes. Easily found with a simple search, and it does work on Windows 10 even though it hasn't been updated for 8+ years. I suspect you'd have to switch to something like Autohotkey for the Esc/Ctrl mapping.
- alienreborn 9y agoI use this app on Mac for the exact key mentioned above Caps -> Ctrl/Esc https://github.com/tekezo/Karabiner-Elements https://github.com/tekezo/Karabiner-Elements
- tetraodonpuffer 9y agoas the two other sibling posters said, I use karabiner elements when on os/x and xcape+xmodmap on Linux with this in my .xsession xcape -e 'Control_L=Escape' which is run after remapping caps lock to Control_L via xmodmap (just xmodmap -pke to create your xmodmap file, xev to figure out which keycode your caps is, and edit the file after to make that keycode Control_L. For example my xmodmap file, which also sets up meta/super and other overrides is ! ! Clear the modifiers ! clear lock clear shift clear control clear mod1 clear mod2 clear mod3 clear mod4 clear mod5 ! Remapping keycode 37 = F17 NoSymbol F17 keycode 64 = Alt_L NoSymbol Alt_L keycode 66 = Control_L NoSymbol Control_L keycode 90 = Multi_key NoSymbol Multi_key keycode 91 = Mode_switch NoSymbol Mode_switch keycode 105 = Meta_R NoSymbol Meta_R keycode 107 = Menu Sys_Req Menu Sys_Req keycode 108 = Control_R NoSymbol Control_R keycode 127 = Redo Undo Redo Undo keycode 134 = Alt_R NoSymbol Alt_R keycode 135 = Control_R NoSymbol Control_R keycode 164 = Undo Redo Undo keycode 166 = Super_L NoSymbol Super_L keycode 167 = Control_L NoSymbol Control_L ! ! Set the modifiers ! add shift = Shift_L Shift_R add control = Control_L Control_R add mod1 = Alt_L Alt_R add mod2 = Num_Lock add mod3 = Super_L add mod4 = Meta_R add mod5 = Mode_switch
- aidos 9y agoOh that’s interesting!
- Scarbutt 9y agoand enter to ctrl if held and enter if tapped ;) (macbooks don't have a right ctrl key).
- zcid 9y agoAnd what a nightmare it is to jump on a macbook because of that. I go crazy when I need to use an Apple keyboard. I can't begin to understand that particular ui choice.
- Lio 9y agoPersonally I prefer to use Karabiner-Elements to remap the right alt-key to ctrl. Been doing that since the first MacBook Pro when the key in that position was “Enter”. I find I don’t really miss the right alt key at all.
- amelius 9y agoI already bound it to Ctrl.
- platinumrad 9y agoI've heard of some people rebinding Ctrl to Esc after doing that. Or there's always dual binding Caps Lock (tapped vs held) as tetraodonpuffer suggested but I've never been able to get used to that.
- chongli 9y agoI bound caps lock to ctrl. I use it with ctrl-[ to escape in vim. Does everything I need.
- dag11 9y agoFun fact, Ctrl+[ also escapes. Had to retrain my muscle memory to use Ctrl+[ when I got my Touch Bar mac, but I think I actually prefer it to ESC. It's guaranteed to work on vim on any system (unlike caps lock), and it keeps my fingers closer to home row.
- spraak 9y agoHm... I was able to 'feel' the ESC key on my touch bar. But I then remapped it to Caps Lock using Karabiner. I also remapped it on my Ubuntu laptop (with Xmodmap) since it's so nice. What systems have you not been able to get it to work on?
- _betty_ 9y agoOther people's (when pair programming)
- derriz 9y agoI've gotten used to typing CTRL-[ instead of reaching for the Escape key because of the inconsistencies in its size and placement on various keyboards I use. Yes it's two fingers but you have to use CTRL in vim to get any benefit anyway.
- Moter8 9y agoQuite difficult to type CTRL-[ for me, as it's actually CTRL+ALT+8 on a german layout keyboard :/ Oh, and on Mac CTRL+ALT+5 if I remember correctly.
- fphilipe 9y agoHave been using a US keyboard and never looked back to the Swiss one. Much better for programming and accents and umlauts are still easy to type. As I also occasionally type in Portuguese, German, Spanish, and French, I find the US keyboard to be the neutral middle ground.
- K0nserv 9y agoThe best line in my whole vimrc is this https://github.com/k0nserv/dotfiles/blob/master/files/vimrc.symlink#L64 https://github.com/k0nserv/dotfiles/blob/master/files/vimrc..... It rebinds jk to ESC. This has the nice property of being a NOP if you happen do do it in normal mode
- spraak 9y agoBut what would it do in visual mode?
- Pete_D 9y agoNothing, but you could add a `vnoremap jk <Esc>` line as well to have it leave visual mode if you wanted.
- K0nserv 9y agoI stil use ESC for visual mode, but as @Pete_D points out you could use jk there too, however it's a much more common input in visual mode so it would probably not work as well.
- cestith 9y agoHere's one way to mitigate that: use a less popular keyboard. I suggest evaluating https://shop.keyboard.io/ https://shop.keyboard.io/ for starters.
- Lio 9y agoI love the idea of a mechanical keyboard but I worry about productivity when I’m on the move. I find it easier to stick to the laptop keyboard and trackpad even when at a desk plugged into a big monitor. Everytime I try to switch to a mechanical keyboard and mouse my wrists start hurting. I guess this would go if I got used to the position but then what would happen when I have to use the laptop keyboard? (So far I’ve tried an IBM model-m and a Pok3r keyboard).
- imahorse 9y agoFrom my experience, my wrists start hurting if I don't use any wrist rests (despite the name, you're supposed to rest your palms on them) Also, tilted or high profile keyboards are less ergonomic IMHO. Don't worry about switching back to the laptop keyboard on the go. You won't be less productive, you will just enjoy it less :)
- eddyg 9y agoJust use Ctrl-C instead of Escape. Often less hand-motion than going all the way to the upper-left, and it works everywhere, without custom remapping of Caps Lock, etc.
- oelmekki 9y agoOn linux, I don't use ESC at all anymore, I just press alt + [a normal mode key], while in insert mode. Like `alt + j`, which will leave insert mode and move one line down. Some alt based sequences are really useful: * alt + e, a : leave current parenthesis and continue inserting (eg, while typing parameters for a function) * alt + shift + a : insert mode at the end of current line * alt + shift + i : insert mode at the beginning of current line, with indentation * alt + p, a : paste before current position, and continue inserting Maybe there's a modifier key with a similar behavior on macosx?
- vram22 9y ago>* alt + shift + a : insert mode at the end of current line Is that different from just Shift-a or capital A, which puts you into append mode at the end of the current line (no matter where you are on the line when you press it)?
- oelmekki 9y agoyep, it does a 'A' in normal mode, after leaving the insert mode (thanks to alt). The different thing is that you do it (alt+shift+a) in insert mode. So the equivalent would be `ESC, A`.
- vram22 9y agoThen I guess that the Alt key generates an ESC char (ASCII code 27 [1]). Seems to tie in with the fact that Emacs docs say that you can use either Alt or ESC for the Meta key - which is used a lot in Emacs commands (IIRC - I am not an Emacs user, just had tried it out earlier and think I remember reading read that). https://en.wikipedia.org/wiki/Esc_key https://en.wikipedia.org/wiki/Esc_key
- oelmekki 9y agoI see. thanks for sharing!
- vram22 9y ago
- vram22 9y agoOn some laptops too :(