// The killer text editor.
MODAL EDITING IS POWER.
While others scramble for their mouse, you'll be flying through code at the speed of thought. Vim's modal editing lets you manipulate text without ever leaving the keyboard. Every key is a power tool.
ESCAPE THE MOUSE.
Your hands were built for the keyboard, not for hunting and clicking. Vim keeps your fingers on the home row where they belong. Once muscle memory kicks in, you'll wonder how you ever lived without it.
CONFIGURATION IS FREEDOM.
Vim is infinitely configurable. Your .vimrc is your superpower. Customize keybindings, plugins, colorschemesβmake it yours. No bloat, no arbitrary restrictions. You control your editor.
12 lessons. Total editor dominance.
Understand modal editing and Vim philosophy
BeginnerMove around with h,j,k,l and word motions
BeginnerEnter text and switch between modes
Beginnerx, d, c commands and the dot operator
BeginnerCopy, cut, and paste with registers
Beginner/, n, N, :s for finding and replacing
BeginnerSelect and manipulate text blocks
IntermediateRecord and playback repetitive actions
IntermediateManage multiple files simultaneously
IntermediateMaster window management
IntermediateText objects, folds, and navigation
AdvancedConfigure and customize your setup
AdvancedVim (Vi IMproved) is a modal text editor built into virtually every Unix system. It's been around since 1991 and remains the editor of choice for developers, sysadmins, and anyone who values speed.
Vim has several modes, but you'll use these three most:
1. What command takes you from Normal mode to Insert mode?
2. What key do you press to return to Normal mode?
Hint: ESC or Ctrl-[
In Normal mode, these four keys are your compass:
1. What key moves you to the end of the current word?
2. What command jumps to the end of the line?
There are many ways to enter insert mode, each with a different purpose:
1. What command opens a new line BELOW the current line and enters insert mode?
2. What command jumps to the end of the current line and enters insert mode?
Hint: Think "append"
In Vim, most commands follow a pattern: operator + motion
Change is delete + enter insert mode:
The most powerful command in Vim. Repeats the last change:
cw to change the word
3. Type new word
4. Press n to go to next word
5. Press . to repeat the change
6. Press n. repeatedly to change all words
1. What does dw do?
2. What does the dot operator (.) do?
"Yank" is Vim's term for copy:
In Vim, delete is actually cut (stored in registers):
Vim has 36 registers for storing text:
"_dd to delete a line without saving it to any register. Useful when you want to cut something but not overwrite what you already copied.
1. What is Vim's term for copy?
2. What command pastes after the cursor?
Use the :substitute command:
\v for regex: :%s/\v<(\w+)\gt;/\1/g removes duplicate words. Or enable with :set magic
1. What command searches forward?
2. What command replaces all occurrences in the file?
Once you've selected text, apply operators:
Ctrl+v lets you edit columns:
1. What visual mode selects entire lines?
2. What key combo enters block visual mode?
Macros record and playback sequences of commands:
Add brackets around each word on a line:
1. What command starts recording a macro to register a?
2. What command plays back the last macro?
A buffer is a file loaded into memory:
A window is a viewport into a buffer:
1. What is a buffer in Vim?
2. What command splits the window horizontally?
Tabs are collections of windows:
1. What command switches to the next tab?
2. How do you maximize the current window?
Text objects let you operate on blocks of text:
ci( = change inside parentheses
da" = delete a quoted string (including quotes)
yit = yank inner tag
1. What text object selects inside parentheses?
2. What command toggles a fold?
Your .vimrc configures Vim to your taste:
1. What setting enables syntax highlighting?
2. What command sets the leader key to comma?