Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Vim return from insert mode to normal mode after a command is finished?

Tags:

command

vim

When Vim is in Insert mode and you press Ctrl-O it switches to normal mode for one command, then switches back to insert mode when the command is finished. Is there the opposite command? To switch to insert mode for typing a word (or a number of letters or a line), then switch it back to normal mode when the typing is finished?

like image 672
alexchenco Avatar asked Jan 21 '10 13:01

alexchenco


1 Answers

Not that I know of, however, if you are repeating the same operation over and over again you can fake it by using the . command in normal mode after you've made the change once.

An alternative (in the same scenario) would be to record a macro and run it from normal mode.

like image 185
Randy Morris Avatar answered Nov 15 '22 00:11

Randy Morris