Why you don't need to remap the escape key in Vim !

Hamza Tamenaoul - Sep 21 '20 - - Dev Community

Vim by its nature is very heavy on the <Esc> key usage. It's very important in the modal editing philosophy of the editor. But when we are talking about Vim, we are talking about minimal hand movement in the first place, since it is the reason behind all of its design choices. For this reason many have found the usage of the <Esc> very unintuitive to use, and prefer to map it to a more easier to access key combination. Many tutorials over the internet suggest changing it to a combination close to the home row like jk, a combo I did not personally find useful.

However the designer of Vim did not forget about the user that might find exhausting to use <Esc>. When diving in the documentation of Vim, we can notice in the intro page by typing:

:help escape
Enter fullscreen mode Exit fullscreen mode

We can read on this page a more clever key combination that is already built in the default Vim configuration.

<Esc>   escape  CTRL-[  27  escape  <Esc>
Enter fullscreen mode Exit fullscreen mode

We can see that <Esc> is also mapped to <C-[>. And this is very interesting since Vim by default gives us a more easier to use key combination for the escape key out of the box.

It can take some time to get used to using this key combination, but it will quickly become your favorite since, you can start from it to make other more interesting key combinations; like an escape key of the built-in terminal.

What do you think about this key combination, or do you already use a more interesting one in your configuration.

. . . . . . . . . . . . . . .