Vim Cheatsheet Online Reference — Master Vim Commands and Key Bindings

This vim cheatsheet online reference covers everything from escaping insert mode (a classic!) to powerful macros and search patterns. Whether you're forced to use vim on a server or deliberately chose it as your editor, this guide has you covered.

What Is Vim?

Vim (Vi IMproved) is a highly configurable text editor built to make text editing efficient. It's available on virtually every Unix/Linux system, making it the default editor for server-side work. Vim's modal editing — separate modes for navigating, inserting, and commanding — seems alien at first but enables expert users to edit text at remarkable speed without leaving the keyboard.

In 2026, Vim and Neovim (a modern Vim fork) remain popular among developers who value keyboard-centric workflows, and Vim key bindings are available in VS Code, JetBrains IDEs, and most other editors.

How to Get Started with Vim

  1. Run vimtutor in your terminal — it's a built-in interactive tutorial that takes 30 minutes.
  2. Understand the modes — Normal, Insert, Visual, and Command-line modes are the foundation.
  3. Learn to exit first:q (quit), :wq (save and quit), :q! (quit without saving).
  4. Practice navigation — Master h/j/k/l, w/b, and gg/G before learning edits.
  5. Build muscle memory gradually — Add new commands one week at a time rather than learning everything at once.

Vim Modes

  • Normal mode — Default mode for navigation and commands. Press Esc to return here from any mode.
  • Insert mode — For typing text. Enter with i (before cursor), a (after cursor), o (new line below).
  • Visual mode — For selecting text. Enter with v (character), V (line), Ctrl+v (block).
  • Command-line mode — For ex commands. Enter with :.

Key Vim Commands

Navigation

h j k l          # Left, down, up, right
w / b            # Next / previous word
0 / $            # Start / end of line
gg / G           # Start / end of file
Ctrl+f / Ctrl+b  # Page down / page up
:42              # Go to line 42
%                # Jump to matching bracket

Editing

x                # Delete character
dd               # Delete line
yy               # Yank (copy) line
p                # Paste after cursor
u                # Undo
Ctrl+r           # Redo
cw               # Change word
ciw              # Change inner word
ci"              # Change text inside quotes

Search and Replace

/pattern         # Search forward
?pattern         # Search backward
n / N            # Next / previous match
:%s/old/new/g    # Replace all in file
:%s/old/new/gc   # Replace with confirmation

Use Cases

Editing Config Files on Servers

When SSH'd into a server without a GUI, vim is your primary editing tool. Knowing how to navigate, make targeted edits, and save is essential for sysadmin and DevOps work.

Quick File Edits in Terminal Workflows

Developers who work primarily in the terminal use vim for quick edits to configuration files, scripts, and notes without breaking their workflow to open a GUI editor.

→ Try DevKits Developer Tools Free
aiforeverthing.com — Developer utilities. No signup required.

Frequently Asked Questions

How do I exit Vim?

Press Esc to ensure you're in Normal mode, then type :q and press Enter to quit (only if no unsaved changes), :wq to save and quit, or :q! to quit without saving.

What is the difference between Vim and Neovim?

Neovim is a modern fork of Vim with better defaults, built-in LSP support for IDE features, Lua-based configuration, and an active plugin ecosystem. Neovim is recommended for new users who want a modern modal editor.

How do I search and replace in Vim?

Use :%s/search/replace/g to replace all occurrences in the file. Add c flag for confirmation (:%s/search/replace/gc), i for case-insensitive. For a single line, use :s/search/replace/g.

Can I use Vim keybindings in VS Code?

Yes. Install the "Vim" extension (vscodevim) in VS Code to get full Vim modal editing within VS Code. Most Neovim features are also available via the "vscode-neovim" extension.

What are Vim macros?

Macros record and replay sequences of commands. Press qa to start recording into register a, perform your actions, press q to stop, then @a to replay. 100@a replays 100 times — powerful for repetitive transformations.

Recommended Hosting for Developers

  • Hostinger — From $2.99/mo. Excellent for static sites and Node.js apps.
  • DigitalOcean — $200 free credit for new accounts. Best for scalable backends.
  • Namecheap — Budget-friendly shared hosting with free domain.