eklitzke.org

repz stosb

Esc is Ctrl-[

I've been a user of vi basically since I started programming.[1] The problem that every vi user has is that on most keyboards the Esc key is in an inconvenient location. I tried a number of tricks like remapping Esc and Caps Lock, but wasn't super happy with any of them.

Then one day I learned that Esc generates the same key sequence as Ctrl-[. Since that day I've abandoned the Esc key and solely rely on Ctrl-[. The [ key is already convenient enough for me (and one I have to type a lot anyway). Since I don't need Caps Lock I typically make mine into an extra Ctrl key. This is great because it gives me a whopping three Ctrl keys (be still, my beating heart). The Ctrl-[ sequence is easy to type since it uses both hands.

I don't know of anyone else in the habit of using Ctrl-[ this way, but I quite like it. If you're a vi user give it a shot, you might find it suits you too.

[1] This is actually a half-truth—I've been using Emacs with evil for a number of years now.