Vim Cheat Sheet
At some point, every engineer or researcher needs to edit files directly from the terminal.
Vim is a fast text editor designed for efficient keyboard-driven workflows. Learning Vim improves speed, focus, and productivity, especially when working on remote servers, configuring systems, writing code, or handling quick edits without leaving the command line.
Below is a concise and practical Vim cheat sheet covering the most useful commands for navigation, editing, searching, file management, and efficient terminal-based development.

Vim is a modal text editor with distinct modes for different tasks.
Understanding these modes is key to using Vim effectively:
- Normal (default): For navigation, editing commands, and text manipulation.
- Insert: For typing and inserting text.
- Visual: For selecting text blocks.
- Command-line: For executing commands.
Start with Vim Tutor
Section titled “Start with Vim Tutor”For anyone completely new to Vim, the best place to start is Vim Tutor. It’s designed to be completed in about 30 minutes. By the time you’re done, you’ll know how to navigate, insert, delete, and save text.
To launch the tutor, just type this command in your terminal:
vimtutorVim basic operations
Section titled “Vim basic operations”A few essential commands to get you started.
Open a file in Vim:
vim <filename>Basic operations:
:h Open the help documentation
:w Save changes:wq Save and quit
:q! Quit without saving changesVim modes and movement
Section titled “Vim modes and movement”Insert mode
Section titled “Insert mode”These commands are used from Normal mode to enter Insert mode.
i Insert text before the cursorI Insert text at the beginning of the line
a Append text after the cursorA Append text at the end of the line
o Open a new line below the current one and insertO Open a new line above the current one and insertBasic motions
Section titled “Basic motions”Navigate your text quickly and efficiently.
h Move leftj Move downk Upl Right
0 Move to the start of the line$ Move to the end of the line
^ Move to the first non-blank character of the linegg Go to the first line of the fileG Go to the last line of the file5G Go to line 5Word motions
Section titled “Word motions”Move between words and characters.
w Move to the beginning of the next wordb Move to the beginning of the previous word
e Move to the end of the current or next wordge Move to the end of the previous word
% Jump between matching parentheses, braces, and bracketsVim editing and deleting
Section titled “Vim editing and deleting”Deleting
Section titled “Deleting”Delete text with these powerful commands.
x Delete the character under the cursordd Delete the current linedw Delete from the cursor to the end of the wordD Delete from the cursor to the end of the lineChanging
Section titled “Changing”Change commands delete and then put you into Insert mode.
r Replace a single charactercw Change the current wordC Change to the end of the linecc Change the entire lineUndo, redo, and repeating
Section titled “Undo, redo, and repeating”Manage your edits with these essential commands.
u Undo the last changeCtrl+r Redo the last undo. Repeat the last change or commandCopy and paste
Section titled “Copy and paste”These operations are often referred to as “yanking” (copying), “deleting” (cutting), and “pasting.”
yy Yank (copy) the current lineyiw Yank (copy) the entire word
dd Delete (cut) the current linediw Delete (cut) the entire word
p Paste after the cursorP Paste before the cursorVim visual mode
Section titled “Vim visual mode”Use visual mode for selecting and operating on a block of text.
v Start character-wise visual selectionV Start line-wise visual selection
Ctrl+v Start block-wise visual selection
y Yank (copy) the selected textd Delete (cut) the selected textVim searching and replacing
Section titled “Vim searching and replacing”Find and replace text with superpower.
/word Search forward for 'word'?word Search backward for 'word'
n Go to the next matchN Go to the previous match* Search for the word under the cursor# Search backwards for the word under the cursor
:%s/old/new/g Find and replace all 'old' with 'new' in the file:%s/old/new/gc Find and replace all with confirmationVim file navigation
Section titled “Vim file navigation”Vim has a built-in file explorer called Netrw to navigate your project without leaving the editor.
Open the file explorer:
:Explore Open in the current window:Lexplore Open in a new horizontal split (left):Vexplore Open in a new vertical splitNavigate with these keys:
Enter Open a directory or file- Go up to the parent directoryu Go back to the previous directory in historymb Bookmark the current directorygb Jump to a bookmarked directoryVim window management
Section titled “Vim window management”Split your screen to work on multiple files or sections of the same file.
:split Horizontally split the window:vsplit Vertically split the window
Ctrl-w h Move to the window to the leftCtrl-w j Move to the window belowCtrl-w k Move to the window aboveCtrl-w l Move to the window to the right
Ctrl-w q Close the current splitThis is just the beginning
Section titled “This is just the beginning”We’ve demystified some essential Vim shortcuts, giving you the confidence to navigate, search, and edit files efficiently.
The only thing left to do now is practice, practice, and practice.
This is just the beginning of your journey. May the Force be with you!