A quick start guide for beginners to the Vim text editor

Basic functionality

Start vim with the name of the file you want to edit:

vim file.txt

If the file exists, Vim opens it. If the file doesn’t exist, Vim creates it in the current directory and opens it.

Vim has multiple modes. Vim starts in command mode, which is good for moving around and editing text.

Switch to insert mode to enter text by hitting I. Think I for insert.

Get back to command mode with esc

Notice the 1,44 at the bottom right of the screen. 1 indicates the line number while 44 indicates the character number on that line.

See also: An attempt to list all Linux text editors.

To exit Vim, first make sure you're in command mode (esc).

Quit without saving: :q!.

Save and exit: :wq.

Editing with command and visual mode

In Vim, when you delete something, you’re actually cutting it. To paste, use either lower or upper case P.

If you wanna select some text, then copy/cut/delete it, use visual mode.

Moving around with command mode

Arrow keys work just fine in command/visual mode and in insert mode. However, if you want to move around a Vim document with a little less effort, here are some of the keys to do that.

<-- Back to Front Page