Vim is not that bad (10 minutes to "I can use this")
The "how do I quit vim" meme on Stack Overflow is funny for a reason โ vim is genuinely confusing the first time. But the confusion is almost entirely about modes, not about the editor itself. Once the modal idea clicks, vim becomes one of the fastest text editors ever made. Here's the 10-minute path from confusion to competence.
The one idea that changes everything
Every text editor you've used before โ Notepad, VSCode, Word, Google Docs โ has exactly one mode: insert mode. You press letters, those letters appear at the cursor. Done.
Vim has three modes, and that's the whole mental shift:
- NORMAL mode (the default) โ every key on your keyboard is a command. Press
xto delete a character. Pressdthendto delete the whole line. Presswto jump forward one word. It's like having 100 keyboard shortcuts with zero modifier keys. - INSERT mode โ what you're used to. Typing letters makes letters appear.
- COMMAND mode (after you press
:) โ the bottom line becomes editable for file operations.:wsaves.:qquits.:wqsaves and quits.
You're in NORMAL mode when vim opens. To type text, press i (for insert) โ now you're in INSERT mode and can type normally. To stop typing and go back to NORMAL mode, press Escape. That's the whole modal concept.
The nine keys that get you to "I can use this"
You do not need to learn all of vim. You need to learn these nine keys:
| Key | What it does | Mode it works in |
|---|---|---|
i | Start typing (enter INSERT mode) | NORMAL |
Esc | Stop typing (back to NORMAL mode) | INSERT |
h j k l | Move cursor left / down / up / right | NORMAL |
x | Delete the character under the cursor | NORMAL |
dd | Delete the current line | NORMAL |
u | Undo | NORMAL |
:w | Save the file | NORMAL โ COMMAND |
:q | Quit | NORMAL โ COMMAND |
:wq | Save AND quit | NORMAL โ COMMAND |
That's it. If you know those nine keys, you can edit any file on any Linux system. Everything else vim does is optimization.
Why hjkl instead of arrow keys?
This is the question every new vim user asks, and the answer is actually simple: when Bill Joy wrote vi in 1976, the terminal he used didn't have arrow keys. The cursor-movement keys had to be on the home row. h j k l is where your right hand's fingers naturally sit when you touch-type, so that's what he picked.
Why learn them now, 50 years later? Because your hand never has to leave the home row. Every time you reach for the arrow keys, you lose rhythm. Experienced vim users navigate faster than they can with a mouse because every motion is one key press away.
The arrow keys do work in vim, by the way. Nothing stops you from using them. They're just slower.
The "how do I quit vim" meme, solved forever
If you find yourself trapped in vim and you have no idea how to exit:
- Press
Escape(this gets you out of any mode back to NORMAL) - Type
:q!and pressEnter(this quits, throwing away any changes)
The exclamation point means "force." :q! is "quit and I don't care that I have unsaved changes." You will never need anything else to escape vim.
If you do want to save your changes, :wq is the sequence. "Write and quit."
The four keys that move you up a level
Once you're comfortable with the basics, four more keys will 10ร your editing speed:
wโ jump forward one word (faster than pressinglseven times)bโ jump backward one word0(zero) โ jump to the beginning of the line$โ jump to the end of the line
These four are the big unlock. Combined with dd and x and i, you can edit faster than you ever could with a mouse.
The "operator + motion" pattern
Here's where vim gets really interesting. Most commands in NORMAL mode follow the form operator + motion:
dis the delete operatoryis the yank (copy) operatorcis the change operator (delete and enter INSERT mode)
And motions include w (word), $ (end of line), 0 (start of line), G (end of file), and so on. You combine them:
dw= delete a wordd$= delete from here to end of lineyy= yank the current line (special case โyfollowed byymeans "the whole line")cw= change a word (delete it and start typing the replacement)
Once this clicks, vim stops feeling like "a lot of keys to memorize" and starts feeling like a grammar. You don't memorize dw as a separate thing โ you learn d and you learn w and they combine naturally.
Try it โ interactive, in your browser
Reading about vim will only take you so far. Muscle memory is the whole point. LinuxSim ships with an interactive vim tutor that runs a real (small) vim state machine and walks you through 10 lessons:
- Cursor motion (
hjkl) - Insert mode (
iandEsc) - Append (
a) - Delete character (
x) - Delete line (
dd) - Yank & paste (
yy,p) - Undo (
u) - Word motion (
w,b) - Open new line (
o) - Save & quit (
:w,:q,:wq)
Each lesson gives you a starting buffer, a goal, and lets you practice with real keystrokes. When the buffer matches the goal, the lesson advances. Finishing all 10 takes about 20 minutes โ less than this blog post.
When should you actually use vim?
Honest answer: whenever you're on a server over SSH. That's the real reason to learn vim โ it's the only text editor you're guaranteed to have on any Linux machine. It comes preinstalled on every distribution, no exceptions. nano is usually there too, but vim is everywhere.
For day-to-day coding, VS Code is probably a better choice. But if you ever SSH into a server to tweak a config file, or if you're debugging on a remote box and need to quickly edit a log filter, vim is what's waiting for you. Learning the 13 keys in this post means you'll never be stuck again.