Useful Vim key bindings for command and insert modes
2 min readNov 2, 2017
While it’s true that when using Vim one should stay mainly in normal mode and dart in and out of the other modes with surgical precision, knowledge of some key bindings particular to the command and insert modes can enhance your productivity.
The key bindings in this post have been taken from :h ins-special-keys and :h history sections of the Vim help. Most of the bindings involve the Ctrl key and become more “attractive” if you swap Caps Lock and Ctrl.
In the Vim help, insert mode bindings start with i_ and command mode bindings start with c_. Visual mode bindings start with v_.
Bindings common to command and insert modes
- i_CTRL-U n_CTRL-U. Delete all entered characters.
- i_CTRL-W n_CTRL-W. Delete previous word.
- i_CTRL-H n_CTRL-H. Delete previous char.
- i_CTRL-R n_CTRL-R. Insert the contents of a register.
- i_CTRL-K n_CTRL-K. Insert digraph. Very useful for em dashes!
Command (and search) mode only
- c_CTRL-D. List names matching pattern in front of the cursor.
- c_CTRL-B and c_CTRL-E. Go to the beginning/end of the command line.
- c_CTRL-F. When the command risks getting too long and unwidely, switch to the command-line window and edit it as if in normal mode.
- c_CTRL-G /_CTRL-G and c_CTRL-T /_CTRL-T. Move betwen search matches.
- c_CTRL-L /_CTRL-L. Expand current command/search with one character.
Insert mode only
- i_CTRL-D and i_CTRL-T. Remove/add indentation without leaving insert mode.
- i_CTRL-J and i_CTRL-M. Begin new line without leaving insert mode.
Bonus tip: visual mode only
- v_o and v_O. Move around a visually selected block. Might be useful to jump to the end of a text object, after selecting it visually.