Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

What Is Vim? A Beginner’s Guide to Editing, Saving, and Exiting

Install Vim, switch between Normal and Insert mode, and practice essential editing, search, and save commands on a test file.

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.

What is Vim? Detailed installation and usage instructions Picture 1

Vim is a text editor you can use from a terminal.

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.

  1. Press i and type a few lines.
  2. Press Esc. Move with the arrow keys or h, j, k, and l.
  3. In Normal mode, press d twice to delete a line, then u to undo it.

Save, exit, and find text

CommandWhat it does
:wSave the current file.
:qQuit if there are no unsaved changes.
:wqSave and quit.
:q!Quit and discard unsaved edits.
/wordSearch forward. Use n or N to move between matches.
:%s/old/new/gcReplace 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.

What is Vim? Detailed installation and usage instructions Picture 2

Vim plugins can add file navigation, completion, and status information.
Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.