Learning Vim: Day 0

The Absolute Basics

Vim is different than other editors you have used. It is modal. By default, keys you hit do not go into the document you are editing! Instead, they trigger commands. So the first thing you need to do is figure out how to enter text, stop entering text, delete text, save your file, and leave the program.

The Five Most Important Commands

Keys to type What they do
i Shift into insert mode, and actually be able to enter text!
Esc The escape key exits insert mode, and puts you back in command mode. (Ctrl-C does the same thing.)
x Delete character under the cursor.
:w In command mode, this writes your current file to disk.
:q In command mode, this exits vim.

Practice

Call up a practice file in vim (e.g., vim practice.txt) and practice each of the above four commands until your fingers find them almost automatically.