I'm having a problem with the Esc key when I want to return to the interactive mode from the insert mode. Is there exist another key used to release the insert mode.
Existing solutions notwithstanding, the conventional solution in Vim is to remap keys in your
.vimrc configuration. In fact, many Vim users have an easier reachable key remapped to Esc. Popular choices are Ctrl+Enter, or jj, etc.
To enable this, just put something like the following into your
.vimrc and reload it/restart Vim:
" Shift-Enter inoremap <S-CR> <Esc> " Double-j inoremap jj <Esc>
Ctrl-[ sends the same character to the terminal as the physical Esc key. The latter is simply a shortcut for the former, generally.
If you want to be able to use a single key, as a pure *nix solution (without Vim mappings) you could define another key as Esc. Just like Emacs users remap CapsLock to Ctrl some Vim users (me included) remap CapsLock to Esc. This works for any *nix using X11.
xev -event keyboard (and then press CapsLock) to get the keycode for the CapsLock key (for me it is keycode 66). Then you can use
xmodmap to remap the key:
xmodmap -e 'remove Lock = Caps_Lock' -e 'keycode 66 = Escape'
To get this at login you can add the
xmodmap expressions to
~/.Xmodmap as follows:
remove Lock = Caps_Lock keycode 66 = Escape
Although for the second part YMMV, since not all display managers run
~/.Xmodmap. You may need to add
xmodmap .Xmodmap to
.xinitrc on some of them.
You could try Ctrl-C, that works for me and is in my opinion easier than ESC. However I am not sure if it is enabled by default.
Ctrl + F2
Is enabled by default. No need to configure any settings.
You will move to normal mode, where you can do
:q! or :wq.