I noticed that in vim you often have to press Esc to switch between modes. Is it possible to replace Esc in this case with a shortcut key?

  • See: map ,: imap and the rest - alexlz

3 answers 3

In general, I personally use the jj keyboard shortcut.

Add this to your .vimrc

" exit to normal mode with 'jj' inoremap jj <ESC> 

This hack is used by hundreds of vimers, just look at the .dotfiles repositories on github.com. The reason is very simple, you constantly hold your finger on the j button to navigate through the text. And to press any other button you need to move your finger. Try it;)

    There is a built-in Ctrl + C, Ctrl + [.

    If you still want your own, use: map

    • Ctrl + C is very convenient, very often. - BiMaWa

    Even if vim is used in the terminal, then the default behavior of the terminal is often this: alt + letter sends <ESC> , then a letter. So you can exit insert-mode at the same time and do the following.