Basic Vim Commands

Posted in tools with : productivity


Vim is an editor to create or edit a text file.

Two modes:

Change mode from one to the other

From command mode to insert mode, type i/o(ou). From inset mode to command mode, type Esc.

Some useful commands for Vim. (Note: the following commands are only used in command mode.)

Text Entry Commands

Cursor Movement Commands

Exit Commands

Delete

Copy and Paste

Yank is the copy command of Vim.

Paste (used after Yank)

Other Usefull Commands

What’s more, most commands can be repeated n times by typing a number , n, before the command. For example, 10dd means delete 10 lines.

Set Vim for Python

If you want to write Python code in Vim, it is better to set ~/.vimrc (for Mac) to support Python syntax, indent, etc. For default, there is not such file in the HOME path. Just create one. For the content, refer to official configuration at here.