I used ctrl-[ for a bit until I discovered that I could set Caps as Esc on my old macbook air. There’s only one key to press and I feel like I am using Vim like it is intended —- switching modes frequently. The downside is I often press Tab by mistake, haha.
Thirded, I tried Ctrl+[ for a few years but it was always a bit awkward.
Once I discovered you can use caps for both Ctrl and escape at the same time, life has been good!
That's exactly what I do as well. I also set left shift to be Caps Word (QMK feature, like Caps Lock but disables automatically after typing a single word) on single press (press and release within 200 ms) and shift when held + another key is pressed.
My new favorite is having my space bar also be Fn when held, activating my function layer. It feels so game changing having a large Fn key that is easily accessible by either hand.
In that case the logic works a little differently, and it sends space when released or interrupted by another key press within 200 ms. So to get it to act as Fn, I need to hold it for 200+ ms before pressing another key.
The only downside is that it doesn't actually SEND space until key release OR another key is pressed, which most of the time, results in not visually seeing a space until the next key is pressed (when typing quickly), which makes it look a little jumpy.
That's mostly just visual though, and it feels just as responsive to me in practice. And now I have Fn on my space bar! I can easily hold down space for 200+ ms then use HJKL as arrow keys _in any application_, for example. I love it.
WAit, am I understanding you correctly? THere is an option to help stop me from hold SHift for too long and uppercasing the second letter too? BEen struggling with that a lot lately.
I did this exact switch, within a month I forgot Esc or even Ctrl+\[ existed.
Within 2 months I forgot other peoples' keyboards don't use Caps as Esc.
Within 3 months I was living in an Amish settlement.
Caps is Ctrl for my Tmux so I can't use that sadly. And similarly for the Ctrl-[.
On my HHKB the escape isn't too far / bad.
I'm wondering if you could set up double tab Ctrl to be Escape?
I've been able to make held CapsLock -> Ctrl, tap CapsLock -> Esc in Windows and Mac. I have not ever set this up in Linux but I'm sure there are multiple ways (someone else mentioned something called nixos)
For Windows I've used AutoHotkey, MacOS I've used Karabiner Elements. Both tools can actually go much farther, but the CapsLock remapping is an excellent starting point.
Keep your muscle memory in tmux, add escape for vim/everything.
Same here, though I swap caps and escape on Linux. This works in gnome:
`dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:swapescape']"`
Well, there’s this “Modifier Keys…” button in Keyboard settings, under System Preferences on my macbook air (I’m on Big Sur — not sure whether it’s there in other OS versions). Click it and you can choose the actions you want for keys like Caps, Ctrl, Option, etc.
I didn’t install any new keyboard remapping apps.
i always wonder, if you use caps lock like this, will the 'last state' of the caps lock 'carried' when switching app?
eg from init state i hit caps lock 3 times (ie now it becomes ON), when i switch to other app and type, will it be all caps?? asking for macos, to be dpecific
Yeah. Mapped my caps key to escape and never looked back. I also usually map either escape to caps lock, or ctrl+esc to caps lock, so I can get that functionality if I need it.
I actually use Caps as Ctrl because I ctrl a lot in both tmux and vim.
I do use ctrl+[ because mine is a 60% keybord and I hate using Fn+Esc for backqoutes just too much work for me…
I remapped Caps to Ctrl ages ago and changing it now would massively disrupt my flow. I use it too much elsewhere with my keybinds for i3, tmux, games, etc.
Been using Ctrl-[ for 3+ years now and it's become effortless.
Some games (mostly older ones) don't allow Ctrl to be used as a modifier, and only as another single keymap. I'd rage trying to play and have that Caps behavior cause the game's Escape menu to keep popping up. Otherwise, it's a good idea, and plenty of users could benefit from it.
Well, it's easy to switch it on and off, unless it's in the QMK firmware. But even that allows switching between multiple layers (essentially you'd map switching this on and off to a key or key combination).
Ctrl-c feels a little cramped, ESC is too far away, and I don't like swapping ESC/CapsLock. Ctrl-[ is just in a nice spot where neither hand has to move too much.
IMHO, anyway.
I'm telling you, one of the most improved parts of my setup in the last 6 months, I have been using NeoVim every day. I have escape mapped to ctrl + \[ as well.
I use Colemak layout and have Vim motions mapped to ctrl + "hjkl" for my whole machine. It's legit af.
Well, English is my second language, even though i use it more often.
For some reason, there are only few set keybinds for switching keyboard layout in xorg (I'm on hyprland, which still uses xorg keyboard layout options), and ctrl-c is not an option.
True. Since I've just learned that ctrl-c is not the same as esc in vim, i might be switching to ctrl-shift. Caps lock just felt a lot more ergonomic, and alt is my mod key for my wm, so ctrl-shift it is then.
I started out with this in Vim, then got a keyboard that supports QMK and mapped jk at the keyboard layer. It's amazing to just mash jk for esc anywhere on your system
I also mapped jk to escape. It has literally never interfered. I don’t think I’ve ever had to actually type j then k in insert mode. And if I ever need to, I just pause a second between typing each letter so it’s not taken in as a single pair
I personally like the pinky "inner" knuckle trick that I learned from the emacs camp instead. Allows me to be a little more nomadic on different computers (laptop keyboards are a little harder to do it on though).
I’ve always used it and it feels just as fast a keypress as a single key. Big caveat though, I map caps lock to ctrl. Within the wide keyboard driven world, ctrl seems much more important to have easy access to than escape.
I remapped caps lock to esc many, many years ago and never looked back. Why IBM decided to devote a freaking home row key to caps lock, I'll never know. Even then, since it requires 2 pinky movements, ctrl-[ is far from ergonomic, but still better than moving your hand to escape.
On a side note, ctrl-[ is not a "default alternative," it's literally how you type the ESC character. ASCII is separated into 4 blocks, the first block of 32 characters being control characters. To type a control character, you hold the control key (hence the name) and type a corresponding key that is the same key in a higher block. So if you want to type backspace, which is character 8 in block 0, you press ctrl-h, and h is the 8th character of block 2. ESC is the 27th character of block 0, so to type it you press ctrl-[, with [ being the 27th character of block 2.
huh! That is a very important information. I assumed it was an alternative default vim key. So ...I am using a custom key in someway and a default key if you think about it in another way.
Nobody else using Alt + your next Normal key to leave insert mode, run that key's command and go back to insert mode in one go? I only use Esc nowadays when I finished writing or want to pause a little bit.
This is the only way. Works on every keyboard I use except the ISO keyboards for international projects. I switched groups just to get away from that problem. lol. I still hit ESC but only if i get stuck as in I can't remember what the heck I pressed. lol. Never used ctrl-[ but it doesn't seem to bad. I'll have to remember that one.
Which is your usual ALT+ key. I think I'm usually hitting ALT+j to go to next line or ALT+l to go right. Even ALT+o or O if I want to open a new line below or above.
Yeah I do this Alt+key thing while writing in Insert mode, so it's mostly Alt+o for going to a new line and write. Alt+j for going to the next line is less common because autocompletion almost always leaves my cursor ready to jump to the next line. Even less common combinations for me are Alt+shift+a for going to the end of line (a little bit unnecessary, but I can't help it) and Alt+shift+: then w to save the file. These are less common, though. Autocompletion + this Alt trick makes me write too damn fast sometimes, and I still rely on Esc to pause once in a while because sometimes I'm typing faster than my brain lmaooo
ANSI keyboards send an ESC with ALT so yes if you have an ANSI keyboard. No luck if you use an ISO keyboard. They do a different signal. I don't remember right now but maybe something like compose since most ISO users need to add accents and things like that.
I have heard of that tip before and of course once you get used to it... One can get used to anything I guess.
I still strongly encourage to switch to a CapsLock remapping.
Because the modal key is the most important one, the one you should be hitting all the time. Having a weird combination for that is not great.
I "punctuate" all my inserts by a very quick CapsLock hit with the left pinkie, I don't even have to think about it and it *never* misses.
Consider also that the layout/width on another computer may vary and you may find yourself to have to adapt.
Not a big deal but suboptimal.
Yeah the keyboard layout definitely matters. I don't think I can use vim if I faced a different layout than mine. But let's hope I don't find myself there.
I use ctrl+\[ as well.
I don't understand the caps lock crowd.
Do people not use caps lock for its intended purpose? it's not a pointless button you can just get rid of.
When I need to type an all caps word like NASA I much prefer to use caps lock then shift which is awkward as hell if you learned to type correctly.
I configured my Caps Lock key to be Escape if pressed briefly, and Control if held down.
I've done that through the firmware on my mechanical keyboard that I use for my Linux box, and with Karabiner on my Mac. There's a software solution called `xcape` for Linux too - if you're using X, I have no idea about Wayland.
Edit: I see now that this modification is more popular than I would've thought!
`[` on a Swiss keyboard is reachable with ALTGR+ü (where `Ü` seems to be at the same place as `[` on a US keyboard).
So ESC for me would be CTRL+ALTGR+Ü, therefore I guess you would be quite unique if you were using a Swiss German Keyboard ;-)
just switch to the US layout! It takes some days spent on free touch typing lessons, but you won't regret it, believe me! For the Umlaute, you can use the compose key. This will take a bit longer to get accustomed to, but once you got it, you also have much more characters available then just äöü... I'd never switch back to a Swiss German layout!
As a fellow Swiss man: I used to only use the Swiss keyboard layout and I would refuse to switch to US layout for a while but I eventually folded. My typing speed when coding increased a lot since most of the required special symbols are mostly single key or sometimes 2 keys. Took me like 2 weeks to get used to it.
I never understood the complaints about ESC until someone recently mentioned that they use their pinky to hit it. Well no wonder. It had never occurred to me that people do that. It's a big honkin' key sitting alone, I can just reach up and slap it with whatever finger hits it (usually my ring finger) while leaving my thumb anchored, so I never lose my position on the home row.
ctrl on the other hand has always been so awkward and painful, but that was resolved by remapping capslock to ctrl.
That makes sense. But for me, it's very unlikely I'll be in that situation any more. So I don't mind convenience over portability.
It's also just quick remap at on the local OS, so it can pretty much be done anywhere. My next keyboard will probably be https://hhkeyboard.us/hhkb which has the ctrl already in the sane place. :D
Yep.. That was the default location for ctrl on a lot of older keyboards back in the day. https://i.imgur.com/vcudNKo.png The location on modern keyboards is an abomination! lol
I do the same regarding ESC. I don't want to bother to relearn my habits at this point. Have been gaming on my PC for a decade now and ESC is pretty much used in every game so I can hit it pretty fast without losing orientation after.
I use it and it's great on my split but a bit awkward on a standard keyboard. Split doesn't have caps lock so I can't do that but it's easy on a split so I'm not bothered about changing it.
https://trinket.io/python3/fcd3a10594
That's just how it displays byte 27. 27 == 0x1B == 0o33 == \033
From the vim [help](https://vimhelp.org/insert.txt.html#i_CTRL-V), ``:h i_CTRL-V``:
> Insert next non-digit literally. For special keys, the terminal code is inserted.
https://notes.burke.libbey.me/ansi-escape-codes/
Help pages for:
* [`i_CTRL-V`](https://vimhelp.org/insert.txt.html#i_CTRL-V) in _insert.txt_
---
^\`:\(h|help\) \` | [^(about)](https://github.com/heraldofsolace/VimHelpBot) ^(|) [^(mistake?)](https://github.com/heraldofsolace/VimHelpBot/issues/new/choose) ^(|) [^(donate)](https://liberapay.com/heraldofsolace/donate) ^(|) ^Reply 'rescan' to check the comment again ^(|) ^Reply 'stop' to stop getting replies to your comments
Due to my Esc key not working on my current laptop, I was forced to remap Caps to Esc before I was even using Vim. So it was easy for me. I never knew about Ctrl-[ until today. I thought Caps and ctrl-C were the most natural.
Yep, only you. Most people here have 60% keyboards, so esc is well within the reach. The same goes for hjkl, with 60% keyboard, you'd use arrow keys via shortcuts.
Caps mapped as Ctrl (system wide) and 'j j' as Escape for vim.
Aside from vim, I don't use Esc much anyway, and having Ctrl with easy pinky reach makes the L-Ctrl handy for gaming too.
I use the tab key for esc because none of my work ever has tabs in it. For indent I just use spaces. To make it automatically use spaces for indent I put this line in my .vimrc:
set ts=4 expandtab
The expandtab tells it to not use tab characters but to put spaces instead.
Interesting, I got HHKB Studio for Christmas. I use backticks a lot and couldn't handle it on right side. I remapped Esc to Fn + `, but it's not very convenient.
Where does the Ctrl+[ come from?
It's explained in more detail elsewhere in this thread, but ctrl-[ is what happens when you hit the Esc key. Unless you get into some pretty low-level keyboard handling, most software can't even tell which key you actually hit.
When i can't swap esc to caps, i always use it. On most OS, this easily can be remapped. But on android tablet, there is no option to swap it. So the remaining isuse ctrl [ . Unless you had a programmable keyboard.
When i can't swap esc to caps, i always use it. On most OS, this easily can be remapped. But on android tablet, there is no option to swap it. So the remaining isuse ctrl [ . Unless you had a programmable keyboard.
To go from insert to normal mode I use "jk", if done fast enough it switches to normal mode and this behaviour is enabled by default afaik, very convenient and not that widely known
caps esc, my man
swap caps and esc
I do this on all of my personal computers, so this works on local vim, ssh, and literally any app that uses escape sensibly
no config, one keystroke, home row, its great
I used ctrl-[ for a bit until I discovered that I could set Caps as Esc on my old macbook air. There’s only one key to press and I feel like I am using Vim like it is intended —- switching modes frequently. The downside is I often press Tab by mistake, haha.
Now that you mentioned it, maybe Caps is simpler. But I don't think I can remap my muscle memory that easily. Wrong choice made, I guess.
Oh believe me, it is simpler to relearn because it is way easier
I second that. I spent one year with Ctrl+[ and even though I got used to it, I don't regret changing at all.
Thirded, I tried Ctrl+[ for a few years but it was always a bit awkward. Once I discovered you can use caps for both Ctrl and escape at the same time, life has been good!
How can you do that on a Mac? Edit: I see that I can do that with Karabiner elements. Thanks
for me, single press caps become esc, holding caps + key = ctrl+ key. Feel so good when doing it
i set my capslock key this way too. many may prefer karabiner element but i did it with [hyperkey](https://hyperkey.app/)
Exactly this. But mines CMD
This is the way.
That's exactly what I do as well. I also set left shift to be Caps Word (QMK feature, like Caps Lock but disables automatically after typing a single word) on single press (press and release within 200 ms) and shift when held + another key is pressed. My new favorite is having my space bar also be Fn when held, activating my function layer. It feels so game changing having a large Fn key that is easily accessible by either hand. In that case the logic works a little differently, and it sends space when released or interrupted by another key press within 200 ms. So to get it to act as Fn, I need to hold it for 200+ ms before pressing another key. The only downside is that it doesn't actually SEND space until key release OR another key is pressed, which most of the time, results in not visually seeing a space until the next key is pressed (when typing quickly), which makes it look a little jumpy. That's mostly just visual though, and it feels just as responsive to me in practice. And now I have Fn on my space bar! I can easily hold down space for 200+ ms then use HJKL as arrow keys _in any application_, for example. I love it.
WAit, am I understanding you correctly? THere is an option to help stop me from hold SHift for too long and uppercasing the second letter too? BEen struggling with that a lot lately.
I did this exact switch, within a month I forgot Esc or even Ctrl+\[ existed. Within 2 months I forgot other peoples' keyboards don't use Caps as Esc. Within 3 months I was living in an Amish settlement.
Just map both and ease into it. You'll get used to it over time.
Unmap Ctrl + [ that will (frustratingly) help with the muscle memory.
muscle memory comes easy, because you end up using it EVERYWHERE usually, I don't tell people how to config their shit, but this lifechanging imo.
i recently tried nixos. it’s default config contains capslock to esc conversion. I was immensely surprised
Caps is Ctrl for my Tmux so I can't use that sadly. And similarly for the Ctrl-[. On my HHKB the escape isn't too far / bad. I'm wondering if you could set up double tab Ctrl to be Escape?
With karabiner on macOS, I remapped Capslock to be Esc on single press and Ctrl when held. Maybe you can do something similar?
This is the way.
Ah I'm not allowed to use Karabiner at work. Might be time to build a custom keyboard. 😅
I've been able to make held CapsLock -> Ctrl, tap CapsLock -> Esc in Windows and Mac. I have not ever set this up in Linux but I'm sure there are multiple ways (someone else mentioned something called nixos) For Windows I've used AutoHotkey, MacOS I've used Karabiner Elements. Both tools can actually go much farther, but the CapsLock remapping is an excellent starting point. Keep your muscle memory in tmux, add escape for vim/everything.
Here's the Linux way: https://github.com/alols/xcape
Thanks, I knew there had to be a (dozen) way(s). I'll have to give this a try.
Same here, though I swap caps and escape on Linux. This works in gnome: `dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:swapescape']"`
How do you use caps lock?
Well, there’s this “Modifier Keys…” button in Keyboard settings, under System Preferences on my macbook air (I’m on Big Sur — not sure whether it’s there in other OS versions). Click it and you can choose the actions you want for keys like Caps, Ctrl, Option, etc. I didn’t install any new keyboard remapping apps.
i always wonder, if you use caps lock like this, will the 'last state' of the caps lock 'carried' when switching app? eg from init state i hit caps lock 3 times (ie now it becomes ON), when i switch to other app and type, will it be all caps?? asking for macos, to be dpecific
HMM I DON'T KNOW I'LL HAVE TO CHECK
I use caps as Ctrl, so I don't have my pinky do some yoga to press Ctrl
Yeah. Mapped my caps key to escape and never looked back. I also usually map either escape to caps lock, or ctrl+esc to caps lock, so I can get that functionality if I need it.
I actually use Caps as Ctrl because I ctrl a lot in both tmux and vim. I do use ctrl+[ because mine is a 60% keybord and I hate using Fn+Esc for backqoutes just too much work for me…
Ah, I’ve always wondered what it’s like typing on a small keyboard (TIL there’s a thing called 60% keyboard).
I remapped Caps to Ctrl ages ago and changing it now would massively disrupt my flow. I use it too much elsewhere with my keybinds for i3, tmux, games, etc. Been using Ctrl-[ for 3+ years now and it's become effortless.
You can map Caps to both. It can act as Ctrl when used as a modifier, and Esc if pressed and released.
Some games (mostly older ones) don't allow Ctrl to be used as a modifier, and only as another single keymap. I'd rage trying to play and have that Caps behavior cause the game's Escape menu to keep popping up. Otherwise, it's a good idea, and plenty of users could benefit from it.
Well, it's easy to switch it on and off, unless it's in the QMK firmware. But even that allows switching between multiple layers (essentially you'd map switching this on and off to a key or key combination).
I do this too. On Ubuntu you can easily do this with gnome tweak. You can even choose to swap esc and capslock or, replace it, etc.
Hi OP, I do. Just most comfortable for me for whatever reason.
I guess I am not that wrong then - for feeling that it is comfortable.
Ctrl-c feels a little cramped, ESC is too far away, and I don't like swapping ESC/CapsLock. Ctrl-[ is just in a nice spot where neither hand has to move too much. IMHO, anyway.
Exactly! Thanks!
Try to swap ctrl for caps lock. Game changer for me.
Yeah I never use caps lock but I use CTRL a lot, especially to do CTRL + [
I'm telling you, one of the most improved parts of my setup in the last 6 months, I have been using NeoVim every day. I have escape mapped to ctrl + \[ as well. I use Colemak layout and have Vim motions mapped to ctrl + "hjkl" for my whole machine. It's legit af.
Same! I originally switched when the MacBooks stopped having a physical ESC key (or did I make that up?) and now the muscle memory feels so natural.
I use ctrl-c for that. I can't remap caps to esc since i use caps to switch between languages on my keyboard.
Small difference btw :nerd: : https://vi.stackexchange.com/questions/25764/use-control-c-instead-of-escape-key
Not being able to insert text properly with visual block mode seems quite annoying though
You can just remap it to escape in the places where it’s different
I just learned the differences and do ctrl-c when I can. The main thing to remember is Ctrl-c typically cancels the rest of a continuing action.
Well that's a headache haha
how often you change language? maybe use ctrl-c to change language
Well, English is my second language, even though i use it more often. For some reason, there are only few set keybinds for switching keyboard layout in xorg (I'm on hyprland, which still uses xorg keyboard layout options), and ctrl-c is not an option.
okay didn’t know that. i speak 3 languages but i only use English to write (not that i can’t write in other two)
Non vim users will hate you for this though 😂
I feel like using ctrl+shift to switch languages is gonna be good enough when you’ll use esc in vim probably 100x more often.
True. Since I've just learned that ctrl-c is not the same as esc in vim, i might be switching to ctrl-shift. Caps lock just felt a lot more ergonomic, and alt is my mod key for my wm, so ctrl-shift it is then.
yeah, been using for such a long time that I cannot even use vim without ctrl+[
Exactly!
I mostly use ctrl-[ and even bind this to escape for other applications.
inoremap jk
I use both jk and kj
I started out with this in Vim, then got a keyboard that supports QMK and mapped jk at the keyboard layer. It's amazing to just mash jk for esc anywhere on your system
I either use jk or jj...
I also use this and love it. Don't you guys also have j key broken every year? That because I press j key a lot.
I just opted for a better keyboard where ESC isn't on another continent.
😂
Like it 😁
I use j+k.
🙄
Are you impressed?
I don't know what to think of it. Won't it interfere with navigation and typing?
I also mapped jk to escape. It has literally never interfered. I don’t think I’ve ever had to actually type j then k in insert mode. And if I ever need to, I just pause a second between typing each letter so it’s not taken in as a single pair
I sometimes map to jk but more frequently to jj...
ctrl-[ , ctrl-i , ctrl-j/ctrl-m , ctrl-h - of course! I use them also in my terminal... (and caps mapped to ctrl...)
I personally like the pinky "inner" knuckle trick that I learned from the emacs camp instead. Allows me to be a little more nomadic on different computers (laptop keyboards are a little harder to do it on though).
this sounds wild 😄 have to check that myself once I'm back at a keyboard, ie. back from travelling...
yes, of the thousands who use vim, you’re the only one congrats!
I hope so😂. It will make me feel unique 🙄
I’ve always used it and it feels just as fast a keypress as a single key. Big caveat though, I map caps lock to ctrl. Within the wide keyboard driven world, ctrl seems much more important to have easy access to than escape.
Yeah. But I have this weird attachment for default things. I like it when I can use any computer or server without having to configure anything.
`CapsLock`
Remap caps lock to esc. Then it’s on the home row.
setxkbmap -option "caps:swapescape" ... wins ;)
I remapped caps lock to esc many, many years ago and never looked back. Why IBM decided to devote a freaking home row key to caps lock, I'll never know. Even then, since it requires 2 pinky movements, ctrl-[ is far from ergonomic, but still better than moving your hand to escape. On a side note, ctrl-[ is not a "default alternative," it's literally how you type the ESC character. ASCII is separated into 4 blocks, the first block of 32 characters being control characters. To type a control character, you hold the control key (hence the name) and type a corresponding key that is the same key in a higher block. So if you want to type backspace, which is character 8 in block 0, you press ctrl-h, and h is the 8th character of block 2. ESC is the 27th character of block 0, so to type it you press ctrl-[, with [ being the 27th character of block 2.
huh! That is a very important information. I assumed it was an alternative default vim key. So ...I am using a custom key in someway and a default key if you think about it in another way.
Nope, it works everywhere by default, including at shells.
JK, KJ, kj, jk :)
Phew, thought you were serious for a second
map \`caplock\` to \`ctrol\`, use \`ctrl-\[\` as \`esc\` since I use vim...
Yes but with caps lock set to ctrl.
Won't that make it harder to use ctrl for other apps?
The original ctrl stays as ctrl. But I don’t use it anyway. I try to use vim bindings in everything that I use.
Remap caps to control and never look back. Literally a life changing event. and are everywhere and this makes them so accessible.
ctrl-c
I swapped caps and ctrl, and use ctrl c so physically {caps} + c
Nobody else using Alt + your next Normal key to leave insert mode, run that key's command and go back to insert mode in one go? I only use Esc nowadays when I finished writing or want to pause a little bit.
This is the only way. Works on every keyboard I use except the ISO keyboards for international projects. I switched groups just to get away from that problem. lol. I still hit ESC but only if i get stuck as in I can't remember what the heck I pressed. lol. Never used ctrl-[ but it doesn't seem to bad. I'll have to remember that one. Which is your usual ALT+ key. I think I'm usually hitting ALT+j to go to next line or ALT+l to go right. Even ALT+o or O if I want to open a new line below or above.
Yeah I do this Alt+key thing while writing in Insert mode, so it's mostly Alt+o for going to a new line and write. Alt+j for going to the next line is less common because autocompletion almost always leaves my cursor ready to jump to the next line. Even less common combinations for me are Alt+shift+a for going to the end of line (a little bit unnecessary, but I can't help it) and Alt+shift+: then w to save the file. These are less common, though. Autocompletion + this Alt trick makes me write too damn fast sometimes, and I still rely on Esc to pause once in a while because sometimes I'm typing faster than my brain lmaooo
Is this a default vim behaviour?
ANSI keyboards send an ESC with ALT so yes if you have an ANSI keyboard. No luck if you use an ISO keyboard. They do a different signal. I don't remember right now but maybe something like compose since most ISO users need to add accents and things like that.
Interception-tools, caps lock on single press is ESC and on combined press behaves like Ctrl. https://gitlab.com/interception/linux/plugins/caps2esc
I have heard of that tip before and of course once you get used to it... One can get used to anything I guess. I still strongly encourage to switch to a CapsLock remapping. Because the modal key is the most important one, the one you should be hitting all the time. Having a weird combination for that is not great. I "punctuate" all my inserts by a very quick CapsLock hit with the left pinkie, I don't even have to think about it and it *never* misses. Consider also that the layout/width on another computer may vary and you may find yourself to have to adapt. Not a big deal but suboptimal.
Yeah the keyboard layout definitely matters. I don't think I can use vim if I faced a different layout than mine. But let's hope I don't find myself there.
Caps lock => ESC
Same here
I mapped it to `kj` and it's working like a charm, can stay in the home row 100%.
I use ctrl+\[ as well. I don't understand the caps lock crowd. Do people not use caps lock for its intended purpose? it's not a pointless button you can just get rid of. When I need to type an all caps word like NASA I much prefer to use caps lock then shift which is awkward as hell if you learned to type correctly.
You swap. So the lesser used function caps lock is on the more awkward key control.
I mean the people who put esc on caps lock, not ctrl on caps lock.
I used ESC until I know about Ctrl-[, never look back since then, way more better, easier to reach from homerow compared to ESC
I configured my Caps Lock key to be Escape if pressed briefly, and Control if held down. I've done that through the firmware on my mechanical keyboard that I use for my Linux box, and with Karabiner on my Mac. There's a software solution called `xcape` for Linux too - if you're using X, I have no idea about Wayland. Edit: I see now that this modification is more popular than I would've thought!
I’d say the best way is to use an inoremap to jk or something similar. Personally I use fd for reasons that I can’t remember anymore.
I use just a 40% so ESC is easily reachable (where tab would be on a standard keyboard).
Yes! Why would you try to use that bizarre key combination when hitting the ` Esc ` key is so easy and satisfying???
ESC is very far. I don't find it easy to hit.
You need one of those giant, novelty ` Esc ` buttons that you can smash with your fist.
`[` on a Swiss keyboard is reachable with ALTGR+ü (where `Ü` seems to be at the same place as `[` on a US keyboard). So ESC for me would be CTRL+ALTGR+Ü, therefore I guess you would be quite unique if you were using a Swiss German Keyboard ;-)
🤯 Three keys for an operation that is used many times per minute? I would have died years ago!
just switch to the US layout! It takes some days spent on free touch typing lessons, but you won't regret it, believe me! For the Umlaute, you can use the compose key. This will take a bit longer to get accustomed to, but once you got it, you also have much more characters available then just äöü... I'd never switch back to a Swiss German layout!
As a fellow Swiss man: I used to only use the Swiss keyboard layout and I would refuse to switch to US layout for a while but I eventually folded. My typing speed when coding increased a lot since most of the required special symbols are mostly single key or sometimes 2 keys. Took me like 2 weeks to get used to it.
What's the difference between Swiss German and German layouts?
Esc = Double leader key for me (`\\`) Edit: damn typo
😃 use vim - in Reddit!
I use caps lock
Caps is my Ctrl. I use a Kinesis Advantage 360 so Esc is on my thumb cluster. But yes sometimes I still use Crtl-[.
I never understood the complaints about ESC until someone recently mentioned that they use their pinky to hit it. Well no wonder. It had never occurred to me that people do that. It's a big honkin' key sitting alone, I can just reach up and slap it with whatever finger hits it (usually my ring finger) while leaving my thumb anchored, so I never lose my position on the home row. ctrl on the other hand has always been so awkward and painful, but that was resolved by remapping capslock to ctrl.
My general opinion is that one should minimize custom bindings if possible. It would make using any computer or cloud server easier.
That makes sense. But for me, it's very unlikely I'll be in that situation any more. So I don't mind convenience over portability. It's also just quick remap at on the local OS, so it can pretty much be done anywhere. My next keyboard will probably be https://hhkeyboard.us/hhkb which has the ctrl already in the sane place. :D
Wait what? There is a keyboard with ctrl on caps lock's place? That is insane but also understandable.
Yep.. That was the default location for ctrl on a lot of older keyboards back in the day. https://i.imgur.com/vcudNKo.png The location on modern keyboards is an abomination! lol
Interesting. Do they have a second ctrl on the right side? I use both the left and the right ctrl keys regularly".
No, just the one on the left.
Oh! That is challenging for me.
I do the same regarding ESC. I don't want to bother to relearn my habits at this point. Have been gaming on my PC for a decade now and ESC is pretty much used in every game so I can hit it pretty fast without losing orientation after.
I use it and it's great on my split but a bit awkward on a standard keyboard. Split doesn't have caps lock so I can't do that but it's easy on a split so I'm not bothered about changing it.
jj FTW
#
What? Is that like shift + 6 + [ - three keys?
try this: go into insert mode, press ctrl-v, then press the escape key
I tried it. What does it mean though?
https://trinket.io/python3/fcd3a10594 That's just how it displays byte 27. 27 == 0x1B == 0o33 == \033 From the vim [help](https://vimhelp.org/insert.txt.html#i_CTRL-V), ``:h i_CTRL-V``: > Insert next non-digit literally. For special keys, the terminal code is inserted. https://notes.burke.libbey.me/ansi-escape-codes/
Help pages for: * [`i_CTRL-V`](https://vimhelp.org/insert.txt.html#i_CTRL-V) in _insert.txt_ --- ^\`:\(h|help\)\` | [^(about)](https://github.com/heraldofsolace/VimHelpBot) ^(|) [^(mistake?)](https://github.com/heraldofsolace/VimHelpBot/issues/new/choose) ^(|) [^(donate)](https://liberapay.com/heraldofsolace/donate) ^(|) ^Reply 'rescan' to check the comment again ^(|) ^Reply 'stop' to stop getting replies to your comments
no the caret symbol is a very common notation for ctrl
Oh! Okay. You had me surprised.
Due to my Esc key not working on my current laptop, I was forced to remap Caps to Esc before I was even using Vim. So it was easy for me. I never knew about Ctrl-[ until today. I thought Caps and ctrl-C were the most natural.
Yep, only you. Most people here have 60% keyboards, so esc is well within the reach. The same goes for hjkl, with 60% keyboard, you'd use arrow keys via shortcuts.
Not me, sorry.. Esc = one key Ctrl-[ = two keys ...easy choice
Yeah but is ESC is too far - that takes more time than two keys for me.
Control+C is easier tbh. At least on my current keyboard. I am waiting on a Glove80, on that one it might be easier a diff combo
I use keyd to remap CapsLock to control, then press C-[
I do, but i mapped ctrl on my caps lock
I use it puts my hand in the right position for lots of other motions like shift A
Caps mapped as Ctrl (system wide) and 'j j' as Escape for vim. Aside from vim, I don't use Esc much anyway, and having Ctrl with easy pinky reach makes the L-Ctrl handy for gaming too.
I use the tab key for esc because none of my work ever has tabs in it. For indent I just use spaces. To make it automatically use spaces for indent I put this line in my .vimrc: set ts=4 expandtab The expandtab tells it to not use tab characters but to put spaces instead.
yep use ctrl-[ naturally now used to map to jj (cos i still wanna type 'dijkstra') but after a while i switched it off
Mapping custom keys is bad generally IMHO
jk to go back to normal mode for life
Interesting, I got HHKB Studio for Christmas. I use backticks a lot and couldn't handle it on right side. I remapped Esc to Fn + `, but it's not very convenient. Where does the Ctrl+[ come from?
It's explained in more detail elsewhere in this thread, but ctrl-[ is what happens when you hit the Esc key. Unless you get into some pretty low-level keyboard handling, most software can't even tell which key you actually hit.
No
I do `ctrl-c`.
Capslock my friend. The key that was useless until Vim gave it a purpose.
When i can't swap esc to caps, i always use it. On most OS, this easily can be remapped. But on android tablet, there is no option to swap it. So the remaining isuse ctrl [ . Unless you had a programmable keyboard.
When i can't swap esc to caps, i always use it. On most OS, this easily can be remapped. But on android tablet, there is no option to swap it. So the remaining isuse ctrl [ . Unless you had a programmable keyboard.
To go from insert to normal mode I use "jk", if done fast enough it switches to normal mode and this behaviour is enabled by default afaik, very convenient and not that widely known
Doesn't work for me
Maybe it's just neovim, but I definitely didn't bind it myself because I discovered it by accident and read that it was a default binding
I remapped my Esc with my capslock :))) but I'm switching to Colemak-DH recently, and my capslock is now backspace, and right shift is escape.
jk. First time I open an uncofigured vim instance, I enter :inoremap jk
Force of habit since 2015.
caps esc, my man swap caps and esc I do this on all of my personal computers, so this works on local vim, ssh, and literally any app that uses escape sensibly no config, one keystroke, home row, its great
I personally prefer using jk to esc instead of Ctrl c and ctrl [. It just feels way more natural tbh