Hacker News new | ask | show | jobs
by redlewel 50 days ago
You know that CTRL + [ functions same as ESC right? Sr. dev at my job told me about this a year ago and it made vim SIGNIFICANTLY more comfortable to use day to day.
1 comments

I’ve been using vim bindings for a decade and never knew this…
It's about the ascii code and terminal code. (Almost?) Every non-printing character can be entered with Ctrl+<some keyboard key>. With Control pressed, D is eot (end of transmission), G is bell, H is backspace, I is line feed (next line), L is form feed (new page), M is carriage return (start of line), Z is substitute, and [ is escape.
I is tab ('\x09' or '\t') and J is new line ('\x0a' or '\n'). These Ctrl combinations follow a predictable linear mapping to the control character section of the ASCII table. Basically Ctrl subtracts 0x40, so I is 0x49, Ctrl I is 0x09.
TIL: Ctrl subtracts 40.

(28 year emacs user)

on a linux box try `man ascii`
There are lots of man pages. This one doesn't mention Ctrl being minus 40. Not sure what the point is.
This is how I felt when I got told :D