Table of Contents
Vim is a modal text editor. In Normal mode, keys move the cursor and run commands. Press i to enter Insert mode and type normally, then press Esc to return to Normal mode. If you’re stuck in Vim, press Esc, type :q, and press Enter.

Install Vim and edit a practice file
Run vim --version to see whether it’s already installed. If not, use your system’s package manager or the official Vim download page. Then run vim practice.txt. A new file is written to disk when you save it.
- Press i and type a few lines.
- Press Esc. Move with the arrow keys or h, j, k, and l.
- In Normal mode, press d twice to delete a line, then u to undo it.
Save, exit, and find text
| Command | What it does |
|---|---|
:w | Save the current file. |
:q | Quit if there are no unsaved changes. |
:wq | Save and quit. |
:q! | Quit and discard unsaved edits. |
/word | Search forward. Use n or N to move between matches. |
:%s/old/new/gc | Replace matches throughout the file, asking before each change. |
Learn built-in commands before adding plugins
Run vimtutor if it’s installed, or open :help inside Vim. Once the basics are familiar, you can add a file tree such as NERDTree or other navigation tools. Follow the plugin’s own key bindings. They can vary with your configuration.

Reader Comments 0
Sign in with email or Google to join the discussion.