The Ultimate VIM Cheat Sheet and Beginner's Guide
ChatGPT & Benji AsperheimTue Jul 8th, 2025

The Ultimate VIM Cheat Sheet and Beginner’s Guide

VIM is a legendary text editor favored by power users, developers, and sysadmins for its speed, efficiency, and keyboard-driven workflow. If you’ve ever felt lost in its modal editing, you’re not alone—but once you learn its basics, VIM becomes an incredibly powerful tool.

This article offers a compact yet comprehensive cheat sheet, plus extra tips, comparisons, and visual explanations to get you fluent with VIM quickly.

Check out the Git Gist for this to get the latest updates!


Entering Insert Mode

Editing Text

Visual Mode

VIM has three types of visual mode, useful for selecting and manipulating blocks of text.

Searching and Replacing

Saving and Quitting

File and Buffer Management

Window Management

Miscellaneous Essentials


How to Clear a File in VIM

To wipe a file’s contents:

  1. Open the file in VIM: vim filename
  2. Type gg to go to the top.
  3. Press dG — deletes from current position to end of file.

Then save with :w or :wq.


How to Indent Multiple Lines in VIM

Option 1: Visual Line Mode

  1. Move to the first line
  2. Press V to enter visual line mode
  3. Move cursor to select more lines (j)
  4. Press > to indent (or < to outdent)
  5. Press Esc to exit

Option 2: Visual Block Mode

  1. Move to the column to begin indenting
  2. Press Ctrl + v to enter visual block mode
  3. Use j to go down and select block
  4. Press > to indent
  5. Press Esc to exit

Interactive Learning with vimtutor

If you’re new to VIM, there’s nothing quite like hands‑on practice. To launch the built‑in tutorial, simply run this in your terminal:

vimtutor

What you’ll get:

  1. Step‑by‑step lessons covering modes, motion, editing, and more.
  2. Practice exercises built right into VIM—no additional setup required.
  3. A playground buffer you can experiment in; your real files stay safe.

Spend 20—30 minutes here and you’ll internalize the basics far faster than by reading alone.


Comparing VIM vs Emacs

The VIM vs Emacs debate has raged for decades. Here’s a quick breakdown:

FeatureVIMEmacs
Modal EditingYes (Normal, Insert, Visual)No (context-sensitive editing)
Startup TimeVery fastGenerally slower
Learning CurveSteep at firstAlso steep but different
ExtensibilityPlugins, Vimscript, LuaFull programming language (Elisp)
Configuration.vimrc, plugins.emacs, .emacs.d/
Ideal Use CaseQuick edits, terminal workFull IDE replacement
CommunityVery large and activeAlso strong, especially among academics
Mouse UsageMinimal or noneFully supported

Verdict:


Conclusion

VIM can feel like a boss battle at first, but with practice, it becomes one of the most fluid and powerful editing environments available. This cheat sheet gives you the most essential keys to get started and build muscle memory.

Whether you’re editing config files, writing code, or managing content from the terminal, VIM rewards mastery like few other tools do. And if you’re just starting? Bookmark this, practice often, and embrace the hjkl!

Happy editing — and may your fingers never leave the home row.