100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

Vim Cheat Sheet

Vim Cheat Sheet

Essential Vim modal editing commands for navigation, editing, search-and-replace, and multi-file workflows.

2 PagesIntermediateJan 25, 2026

Modes & Navigation

Switching modes and moving around a file.

  • i / a / o- Enter insert mode: before cursor, after cursor, or on a new line below
  • Esc- Return to normal mode from any other mode
  • h j k l- Move left, down, up, right (arrow key alternatives)
  • w / b / e- Jump to next word start, previous word start, end of word
  • 0 / $ / ^- Move to start of line, end of line, first non-blank character
  • gg / G- Jump to first line / last line of the file
  • :<N>- Jump to line number N (e.g. :42)

Editing Commands

Deleting, copying, and changing text.

  • dd / yy- Delete (cut) current line / yank (copy) current line
  • p / P- Paste after cursor / paste before cursor
  • x- Delete character under cursor
  • cw- Change word: delete word and enter insert mode
  • u / Ctrl-r- Undo / redo
  • .- Repeat the last change
  • v / V / Ctrl-v- Visual mode: character-wise, line-wise, block-wise selection

Search & Replace

Find text and substitute patterns.

vim
:/pattern              " Search forward for pattern:?pattern              " Search backward for patternn / N                  " Repeat search forward / backward:%s/foo/bar/g          " Replace all 'foo' with 'bar' in file:%s/foo/bar/gc         " Same, with confirmation per match:s/foo/bar/g           " Replace all occurrences on current line

Files & Windows

Saving, quitting, and splitting the view.

vim
:w              " Save:q              " Quit:wq or :x       " Save and quit:q!             " Quit without saving:sp file.txt    " Horizontal split:vsp file.txt   " Vertical splitCtrl-w w        " Cycle between split windows
Pro Tip

Learn to combine operators with motions (e.g. d2w, ci", y$) instead of memorizing hundreds of commands — Vim's power comes from composing a small set of verbs and motions, not rote memorization.

Was this cheat sheet helpful?

Explore Topics

#Vim#VimCheatSheet#DevOps#Intermediate#ModesNavigation#EditingCommands#SearchReplace#FilesWindows#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech

Professional Web Designing Services

  • Responsive Websites
  • E-commerce Solutions
  • SEO Friendly Design
  • Fast & Secure
  • Support & Maintenance
Get a Free Quote

Share this Cheat Sheet