There are several commands that do something and then enter insert mode. Are there also commands that leave insert mode and do things?
For example, I frequently do this.
The only one I can think of is c-o
, which lets you run one command in normal mode then drops you back into insert mode.
For example, a<c-o>~b
would result in Ab
.
In addition to Esc (which is identical to ^[), ^C also exits insert mode.
ALt + the command lets you execute a command from INSERT mode, for example reference:
alt+o to open newline
alt+A to append
If you'd like to map a few keys to do things like save a file while in insert mode, you can use the imap command. This binds F2 to exit insert mode and save the file:
:imap <F2> <Esc>:w<CR>
This binds F2 to exit insert mode, save the file, and re-enter insert mode:
:imap <F2> <Esc>:w<CR>a
Or:
:imap <F2> <C-o>:w<CR>
Pressing Ctrl-L leaves insert mode in evim, so why not in regular vim, too? Add this to your vimrc: :imap
Or if you don't want to configure vim use Ctrl-[, as suggested by others.