# Vim Keyboard Shortcuts

You will spend a significant part of your time using a text editor, so you might as well pick a good one, be it Vim or Emacs or else. Below is a cheat sheet list of the commands I use every day. To get a better understanding of the logic behind the editor, check out Coming Home to Vim by Steve Losh.

## First contact with the editor¶

Vim has three main modes: default, insert and visual. In the default mode, you don't insert text, but you can move around, copy-paste or type commands. Commands start with a column : and a word such as e (edit) or q (quit). For example:

### Open and close files¶

 :e {file} edit another file :w write file :wq write file and exit :q! exit without saving

When using Vim, if for some reason you don't understand what is happenning, there is one recovery strategy: hit Escape repeatedly and you will always come back to the default mode. You can then exit with :q and start afresh.

Once you are in default mode, you can move the cursor around by hitting directly the motion keys on your keyboard: