4 ms·
When Apple (temporarily) got rid of a physical Esc key I (permanently) retrained myself to type ctrl-[ which is the same character (91 - 64 = 27).
by mprovost 4y ago
When Apple (temporarily) got rid of a physical Esc key I (permanently) retrained myself to type ctrl-[ which is the same character (91 - 64 = 27).
- sushibowl 4y agoPeople who used vi/vim may also know this one as a way to get out of insert mode that is somewhat easier to reach. Nowadays I remap the TAB key to send ESC.
- u801e 4y agoI wonder if that remapping also allows you to use ctrl-i to get out of insert mode. If that's the case, you can switch between the two by pressing i and ctrl-i.
- mprovost 4y agoWell, the article says: "There is no way to distinguish between the Tab key and Control+i. It’s not just ‘the same’ as Tab, Control+i is Tab." So you'd be mapping Tab to Escape to get out of insert mode.
- recuter 4y agoTry mapping jk to ESC.
- kfajdsl 4y agoHow do you indent?
- enriquto 4y agoIf you :set autoindent you'll never need to indent using the tab key. Indentation happens automatically as you write code. In the very rare cases where you need to change the indentation of a line, there's == or, if that doesn't work, you can indent a line forth and back with >> and << .
- wombatpm 4y agoUse spaces like a psychopath?
- SAI_Peregrinus 4y agoI remap CapsLock to Esc, and Shift+Esc to CapsLock. I don't use ALL CAPS that often, so I rarely need to use the combination.
- beej71 4y agoJust like in the old days with the VT-220. No escape key, so ^[ was it. Or ^3, that worked, too, for reasons I never investigated.
- dark-star 4y agoThis is the one time I envy people who use the US layout :-D Ctrl-[ is impossible to type on, say, a German layout, as the [ character is hidden behind AltGr + 8, where AltGr is the right Alt key, which is itself (for most terminals/systems) just the combination of Ctrl+(left)Alt. So you'd basically have to type Ctrl+(Ctrl+Alt)+8 which is not possible.... I remember reading something, or maybe it was a talk on some conference, by someone who had some deep knowledge of the terminal layer. He explained some ways for alternatives to, say, ctrl+i, because something about the way the control characters only use 5 bits and if you type ctrl + a key that has the same lower 5 bits as "i", that also works like ctrl-i or something. I've been trying to find that video (or web page) again but I couldn't. But I think back then I found a replacement for ctrl+[ but I have long since forgotten it ...
- matvore 4y agoFor most terminal emulators (and not gVim or editors with Vim bindings), you can also use Alt+[first key you want to type in normal mode]. e.g. Alt+J to enter normal mode and go down one line. Or Alt+Space to enter normal mode and go forward one space (which usually has the apparent effect of entering normal mode without shifting the cursor backwards, which is pretty intuitive).
- anthk 4y agoDon't use the DE layout and use the US layout with a compose key. For instance, right Windows key or the Menu one. Also, swap Ctrl and Caps Lock: setxkbmap us -option compose:menu -option compose:rwin -option ctrl:swapcaps
- dark-star 4y agoI never understood the "swap ctrl and capslock" thing. Why would you want to move ctrl up to capslock? IIRC only the very first IBM PC keyboards (Model F) had the ctrl key up there. And I get it, muscle memory can be annoying (that's the main reason I stick to the DE layout), but I don't believe that everyone who suggests swapping ctrl and capslock is old enough to have used a model F keyboard in his youth? And I understand that accidentally hitting capslock can also be annoying when typing, but that happens so rarely (for me) that it's not an issue, and one could always just disable the capslock key in that case. What am I missing?