Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Vim is there more than one way to leave insert mode?

Tags:

vim

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...

control[ : w return

Before I create a mapping, is there already Vim command that does that?

like image 522
Ethan Avatar asked Nov 18 '09 18:11

Ethan


Video Answer


2 Answers

In addition to Esc (which is identical to ^[), ^C also exits insert mode.

like image 69
Greg Hewgill Avatar answered Oct 04 '22 15:10

Greg Hewgill


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.

like image 28
David Wolever Avatar answered Oct 04 '22 16:10

David Wolever