Vim is the text editor that ships with virtually every Unix-based system. It's been battle-tested since 1991, and its modal editing philosophy — where you switch between insert mode for typing and normal mode for navigation and commands — is one of the most efficient ways to edit text once you master it. Our free Vim Commands Cheat Sheet gives you instant access to 120+ essential Vim and Neovim commands across 10 categories, with real-time search filtering and one-click copy. No signup, no ads, 100% client-side.
Why Use a Vim Commands Cheat Sheet?
Vim's learning curve is real. The editor has hundreds of commands, and even experienced users don't use them all daily. The commands fall into distinct categories — navigation, editing, visual selections, search patterns, macros, window management, and configuration. Having a structured, searchable reference you can pull up in seconds accelerates your workflow in two ways: (1) it fills gaps when you forget a specific command while editing, and (2) it surfaces commands you did not know existed, helping you level up from basic `hjkl` editing to macro automation, multi-window workflows, and Neovim LSP integration.
10 Command Categories in Our Vim Cheat Sheet
1. Navigation & Movement — Move Without Leaving the Home Row
Vim's navigation model is designed so you never touch the mouse. h, j, k, l replace arrow keys and keep your fingers ready to type. w, b, e move word-by-word. gg and G jump to file boundaries. f{char} and t{char} find characters on the current line with laser precision. Ctrl+D / Ctrl+U scroll half-pages while keeping the cursor centered. % jumps between matching brackets/parens/tags — essential for navigating code blocks. These 12 commands form the foundation of Vim muscle memory.
2. Editing & Insert Mode — Enter, Modify, and Leave
Vim has six ways to enter insert mode, each with a different cursor position: i (at cursor), I (start of line), a (after cursor), A (end of line), o (new line below), O (new line above). Yank (y), delete (d), and paste (p) form the editing triad — each can be combined with motion commands: dw deletes a word, y$ yanks to end of line, d} deletes to end of paragraph. Undo with u and redo with Ctrl+R are the safety net that makes experimentation safe.
3. Visual Mode — Select, Transform, and Manipulate
Visual mode makes Vim's selection power visible. v selects character-by-character, V selects entire lines, and Ctrl+V enters block-visual mode for rectangular selections. Block mode is uniquely powerful: select a column, press I to insert text that appears on every selected line simultaneously. Use > and < to indent/outdent selections, = to auto-format, and ~ to toggle case.
4. Ex Commands — The Command-Line Power Layer
Type : to access Ex commands — Vim's command-line interface for file operations, buffer management, and batch text processing. :w saves, :q quits, and the legendary :wq does both. :%s/old/new/g performs global find-and-replace. :g/pattern/d deletes all lines matching a pattern. :!{cmd} runs shell commands without leaving Vim. :r !{cmd} reads shell output directly into your file.
5. Search & Replace — Find Anything Instantly
/pattern searches forward, ?pattern searches backward. n jumps to the next match, N to the previous. * instantly searches for the word under cursor — one of Vim's most time-saving shortcuts. The substitute command (:s) supports regex, line ranges (:5,10s/...), and confirmation mode (:s/.../.../gc — prompts yes/no for each replacement). The \\v flag enables "very magic" mode where regex metacharacters don't need escaping.
6. Registers & Macros — Automate Repetitive Work
Vim has 26 named registers (a-z) plus special registers for system clipboard (+), selection (*), last yanked text (0), and more. "ayy yanks a line into register a; "ap pastes it back. Macros take this further: qa starts recording into register a, you perform your edits, q stops recording, and @a replays the entire sequence. Add a count — 10@a — to run the macro across dozens of lines. This turns minutes of repetitive editing into seconds.
7. Windows, Tabs & Buffers — Multi-File Mastery
Vim's window system lets you edit multiple files side-by-side. :sp splits horizontally, :vsp splits vertically. Ctrl+W h/j/k/l navigates between splits. :tabnew opens a new tab, gt/gT cycles between them. Buffers represent open files: :ls lists them, :bnext/:bprev cycles, :bd closes one. Combined with DevOps terminal workflows, Vim's multi-file capabilities make it a powerful code editor for projects of any size.
8. Marks, Jumps & Folds — Navigate Large Codebases
m{a-z} sets a local mark at the cursor position. 'a jumps back to mark a's line. mA creates a global mark valid across all files — perfect for bookmarking a key function definition. Ctrl+O and Ctrl+I traverse the jump list like browser back/forward. Folds (zf, zo, zc) collapse code blocks for high-level navigation. Together, these features make Vim excellent for navigating large codebases — complementary to Git workflows where you're jumping between different parts of the codebase.
9. Configuration & Customization — Make Vim Your Own
Vim's behavior is controlled through :set options. Essential settings include :set number (line numbers), :set relativenumber (relative line numbers for easier jumps), :set tabstop=4 shiftwidth=4 expandtab (consistent indentation), :set mouse=a (mouse support), and :set clipboard=unnamedplus (system clipboard integration). These go in your ~/.vimrc or Neovim's ~/.config/nvim/init.lua. Like Docker configuration, Vim config is declarative — you describe your preferred state and the editor applies it on startup.
10. Neovim Specific & Modern Plugins — IDE Features in the Terminal
Neovim brings modern IDE capabilities to Vim's modal editing model. gd jumps to a symbol's definition via LSP. K shows hover documentation. [d / ]d navigates diagnostics. Telescope provides fuzzy file finding and live grep. Mason installs language servers and formatters. :checkhealth diagnoses configuration issues. These features, combined with Kubernetes YAML editing and Terraform HCL workflows, make Neovim a complete terminal-based development environment.
Vim vs. IDEs: When to Use Each
Vim excels when: you're working on remote servers via SSH, editing configuration files quickly, doing repetitive multi-line edits (macros beat GUI multi-cursor), or when you want a lightweight, always-available editor that launches instantly. Modern IDEs (VS Code, JetBrains) excel for complex refactoring with deep language integration, visual debugging, and large-team workflows with standardized tooling. Many developers use both — Vim for quick edits and remote work, and an IDE for deep feature development. Neovim with LSP and plugins narrows this gap significantly.
Production Vim Workflow Example
Here's a real workflow for editing a Docker Compose file across multiple environments using Vim:
# Open the file and search for the port mapping
vim docker-compose.yml
/ports
# Create a split with the staging config
:vsp docker-compose.staging.yml
Ctrl+W l # move to right split
# Record a macro to update port numbers
qa # start recording to register a
f8 # find '8' in port 8080
r3 # replace with 3 (changes 8080 to 3030)
n # find next occurrence
q # stop recording
# Run macro on remaining matches
@a # replay macro
@@ # repeat
# Save and close
:wqa # save all splits and quit Getting Started with Vim
If you are new to Vim, don't try to learn all 120 commands at once. Follow this progression:
- Survival (Day 1): Learn hjkl movement, i to insert, Escape to return to normal mode, :w to save, :q to quit. That's enough to edit files.
- Basic Competence (Week 1): Add w/b/e word movement, dd/yy/p for cut/copy/paste, u for undo, / for search, :%s for find-replace.
- Efficiency (Month 1): Master visual mode (v, V, Ctrl+V), f/t character finding, macros (qa...@a), marks (ma, 'a), and window splits (:sp, :vsp).
- Mastery (Ongoing): Registers, folds, jump lists, ex command ranges, Neovim LSP integration, Telescope, custom keybindings.
Keep our Vim Commands Cheat Sheet open in a browser tab while you practice. Search for any command you forget — it's faster than Googling and doesn't break your flow.
Cross-Reference: Vim in Your Dev Toolkit
Vim is the editor, but these tools complete the terminal-based development workflow:
- Git Commands Expansion — Version control operations inside and outside Vim (Fugitive plugin integrates Git into Vim directly)
- Docker Commands — Container management while editing Dockerfiles and docker-compose.yml in Vim
- Kubernetes Commands — Edit K8s YAML manifests with Vim's block editing and syntax highlighting
- Terraform Commands — Write HCL configuration files efficiently with Vim macros and search/replace
- DevOps Commands — The complete terminal toolkit for infrastructure and operations teams
- GitHub Actions CI/CD — Edit workflow YAML files with Vim's bracket matching and indentation
- Bash Scripting — Shell scripting in Vim with syntax highlighting and auto-indentation