Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just a quick note, you can use Ctrl +[ rather than Escape. Saves your fingers from constantly having to reach for that corner.



I bind my CAPSLOCK to ECAPE that way instead of the escape key killing my hand my left pinky finger can just naturally get me out of insert mode by hitting CAPSLOCK.


I used to do this and really enjoyed the convenience.

Whenever I resume a Vim session (from another window/terminal), I have a habit of automatically pressing the (Escape) key to ensure I'm in Normal mode. However, every now and again, I have to use Vim on someone else's computer and muscle memory would cause me to press CapsLock instead of Escape. Then pressing 'h' moves the cursor all the way to the top of the screen instead of one space to the left, pressing 'j' joins the current line to the following one instead of moving the cursor, etc. Because I'm used to typing normal mode keys in quick succession, I've already entered 4 or 5 normal commands before I realise it's all going horribly wrong. I press 'u' a few times to undo the craziness but successive presses of 'U' only undoes the previous Undo action!

In the end, I retrained myself to use Ctrl-[ which isn't quite as convenient but does work on all platforms I've had to use.


Do yourself a favor and figure out how to bind caps lock to press for escape, hold for control. I use a programmable keyboard (web search for QMK if you're interested) but there are software options too. You'll never look back and you'll be baffled how you ever lived without it.


i have ctrl-shift-command-option+hjkl mapped to the arrow keys in any app.(works in tandem with the next config so it's just the press of the caps lock key)

caps+(any other key) mapped to ctrl-shift-command-option+that key(useful to bind to extra shortcuts in an app).

a single just caps lock press alone bound to escape.

and finally right shift + caps lock is bound to toggle caps lock on and off.

works pretty well for me for a long while now.

karabiner elements on macos lets you do all that with "complex modifications" though the config is a bit dumb to do manually as they expect you to download configs from the web.


On Linux you can use the awesome xcape for this


I actually started binding my CAPSLOCK key to F5, and I have F5 set as a tmux attention key, but I've never had too much problem with left pinky finger hitting escape..

A side benefit of this is that F5 is mapped to refresh for a lot of apps (Firefox, for one) so I can hit capslock to refresh a page.


F5 is the Midnight Commander copy key, would never work for me.


That's good for some people, but I have Caps Lock bound to Commmand/Ctrl. The above default key combo works well for me since that way only my right pinky leaves the home row.


Am I the only person who actually finds Esc easier than C-[ or Caps Lock? Maybe it's just heavy muscle memory at this point, but I've been using Esc for years and every time I try to use anything else it just feels clunky.


Esc is often a half height key and is placed in the Function key row. This is quite a stretch if you are touch typing and want to hit Esc while still keeping your index finger on the F key. But you have the same problem with Ctrl. It's sometimes placed under the left shift key, which is a really awkward pinky reach (I think Mac keyboards have the Command key in a slightly better place, but I haven't used a Mac keyboard extensively, so I'm not sure). For me, since I have a Japanese keyboard with a short space bar and an extra key on either side of it, I make the extra key on the left a Tab key, which I hit with my thumb. Then I make the Caps Lock a control key (to match the old place it used to be) and the Tab key becomes the Esc key. The nice thing about that is that it's usually oversized so easy to hit. It's also an easy reach.

But sometimes I hit the real Esc key out of habit :-)


Using the ring or middle finger allows you to hit the escape with very little motion and you can find the home row again afterwards without looking. Try it - usually takes the slightest wrist angling and extension of the fingers.


On my keyboard I need ALT GR for [. On a side note, I'm rather disappointed that the ESC key didn't get updated with modern keyboards. The keyboard vi was designed on had ESC where Capslock now resides.


I despise and hate with passion the Capslock key. On linux I always run setxkbmpap -option caps:escape. I wish the same could be done on Windows. I got used to it so much that I find myself from time to time writing catpital letters when I'm on Windows or foreign setup.

My hate for the key came years before I thought about the possibility of remapping it. Similarly, I hate the F1, a key that when accidentally pressed on some windows machines inside programs like excel can steal the focus and leave the computer unusable until it loads the useless help sidebar (when all I wanted was hitting the F2 for editing a cell content).


> I wish the same could be done on Windows

You can:) https://vim.fandom.com/wiki/Map_caps_lock_to_escape_in_Windo...


I use autohotkey...

This is a bit older than my current bindings, but this does 3 useful bindings

https://github.com/keithn/vsvimguide/blob/master/vsvim.ah

CapsLock = Esc

Alt-J = Down Arrow

Alt-K = Up Arrow

this is super useful in non vim editors that support vim bindings, and the browser with vimium. The arrow keys are for where you get a dropdown list and don't want to touch your arrow keys. In Visual Studio where I use vim keybindings ( using VsVim ) a lot of refactorings / auto complete gives dropdown options and this gives an easy way to select them without leaving your homerow.


That page mentions the 'uncap' tool which I have been using for a while. It is excellent. Download the few kb executable from GitHub, launch it once, place it in your startup folder, and it just works forever.

If you don't have admin then you'll need to launch it every boot since you can't put it into the startup folder.

To get to the startup folder, open the start menu, right click on an application (might have to be a windows-included app, like Edge, instead of a 3rd party one), and do 'open in folder', then go up to the Start Menu folder if necessary and then into the startup folder. Google says the path of that is this, but I haven't verified:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

Programs / links in there get autorun at boot :)

I haven't tried it but it appears there's a user-specific startup folder which might work without admin: C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup


Hi! Author of Uncap here. I am glad to know that you find it useful. Putting the executable in the startup folder is how I use this tool too.


Yes, technically it's possible, but it is too complex and too permanent to run on every machine and server I log into. Perhaps I should set those registry keys on my own Windows VM though. Thanks for the reference.


buy a keyboard that lets you customize keybindings. my anne pro cost me probably less than $50 and there are many other (better!) choices out there


You can do that on windows, in some way. I've got it setup like that (former caps lock key acts like control), but I don't remember exactly what the setting was.


It's a registry edit, but SharpKeys is a small GUI for editing that part of the registry: https://github.com/randyrants/sharpkeys


Are your sure it wasn't control? I know the ADM terminals were set up that way and they even had the arrows on HJKL.



That's what I do, and lately I've been recommending it more often to others when I hear them complain about the lack of a hardware Esc key on MacBook Pros.


ESC is a much much larger target requiring much much less peripheral attention. Maybe I'm not as good a touch-typist as I like to think I am.


And ctrl+m for newline. Tose two are great to keep hands in the home rows




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: