All articles

I Almost Left VS Code for Vim — Then I Found the Vim Extension

I was convinced I needed to ditch VS Code and go full Vim. Then I discovered the VSCodeVim extension and realized I didn't have to choose. Here are the commands I learned during that obsession — and why you can use all of them without ever leaving VS Code.

Eissa Saber profile photo
Eissa SaberMay 24, 2026 · 6 min read

I spent a week convinced I needed to switch to Vim

It started with a rabbit hole. I was watching a developer on YouTube fly through code with no mouse, no clicking, no fumbling — just pure keyboard. I looked it up: Vim. I went deep. I read about how it makes you faster, how real developers use it, how VS Code is for beginners. I genuinely planned to switch. I even started practicing in the terminal. Then a friend mentioned the VSCodeVim extension, and I installed it half-skeptically. That was it. I got almost everything I was chasing without leaving the editor I already knew. This post covers the commands I learned during that obsession — all of which work perfectly inside VS Code with the extension installed.

The one thing you must understand first: modes

Everything confusing about Vim comes from not internalizing this one concept. Vim isn't always in 'typing mode'. It switches between states, and what keys do depends entirely on which mode you're in. Once this clicks, Vim stops being baffling and starts being logical.

TEXT
Normal Mode  → navigate, run commands, manipulate text
Insert Mode  → type text (like a regular editor)
Visual Mode  → select text with keyboard motions
Command Mode → save, quit, search, replace

1. i — enter Insert Mode

Press i to start typing before the cursor. There's also a (after cursor), A (end of line), o (new line below), and O (new line above). I use o constantly — it's the fastest way to add a new line and start typing without reaching for End or Enter first.

Shell
i insert before cursor
a insert after cursor
o new line below, enter insert
O new line above, enter insert

2. Esc — your escape hatch

Whenever you're confused or things are behaving unexpectedly, press Esc. It drops you back into Normal Mode. One tip that made a real difference: remap Caps Lock to Esc in your OS settings. Esc is too far to reach comfortably for how often you'll press it, and Caps Lock is a key most people never use anyway. Works in VS Code with the extension just as well as in terminal Vim.

Shell
Esc

3. :w — save the file

In VS Code with the extension, :w triggers a save just like Ctrl+S. You don't need it since VS Code auto-saves, but the habit of typing :w between changes is something Vim users build naturally. It doesn't hurt to have it.

Shell
:w

4. :q and :wq — close the editor tab

In VS Code, :q closes the active tab. :wq saves and closes. These work with the VSCodeVim extension. Worth knowing if you ever use Vim in the terminal too — the commands are the same everywhere.

Shell
:q
:wq

5. :q! — close without saving

Discards unsaved changes and closes the tab. In VS Code this still triggers the 'unsaved changes' dialog unless you've enabled auto-save, but in terminal Vim it exits immediately. Good habit to know regardless.

Shell
:q!

6. hjkl — move without leaving home row

This felt awkward for my first two weeks. Now reaching for arrow keys feels like the awkward option. h/l move left/right, j/k move down/up. The payoff is that your hands never leave the home row, which matters when you're moving around code all day.

TEXT
h  ← left
j  ↓ down
k  ↑ up
l  → right

7. w and b — jump by word instead of character

w jumps forward to the start of the next word. b jumps backward. These made navigation actually fast for me — instead of holding a key and waiting, you hop through identifiers instantly. Capital W and B do the same but treat punctuation as part of words.

Shell
w jump to next word start
b jump to previous word start
e jump to end of current word

8. gg and G — jump to file start or end

gg takes you to the first line of the file instantly. G jumps to the last line. In a 300-line component, these replace a lot of Ctrl+Home / Ctrl+End muscle memory that used to require a keyboard shortcut.

Shell
gg top of file
G bottom of file

9. 0 and $ — move within a line

0 goes to the very start of the line. $ goes to the end. I use $ constantly — jump to end of line, append something, back to Normal Mode. The caret (^) goes to the first non-whitespace character, which is often more useful than 0 for code.

Shell
0 start of line
^ first non-whitespace character
$ end of line

10. dd and yy — delete and copy entire lines

dd deletes the current line and puts it in the buffer (it's actually a cut). yy copies the current line. Then p pastes below the cursor. I use dd + p to reorder lines constantly when refactoring — it's faster than any drag-and-drop.

Shell
dd cut current line
yy copy (yank) current line
p paste below cursor
P paste above cursor

11. u and Ctrl+r — undo and redo

u undoes the last change. Ctrl+r redoes it. Vim's undo history is persistent in recent versions — it survives closing and reopening the file if you configure it. Knowing you can undo freely makes editing less cautious, which is a good thing.

Shell
u undo
Ctrl+r redo

12. / — search through a file

Type / followed by what you're looking for and press Enter. Then n jumps to the next match, N goes backward. When I'm reading an unfamiliar codebase and want to find where a function is called, / is faster than any editor's Ctrl+F because my hands don't move to a dialog box.

Shell
/handleSubmit
/useState
n next match
N previous match

13. v — Visual Mode for text selection

v enters character-by-character visual selection. V selects whole lines. Once you've selected something, you can yank it (y), delete it (d), indent it (> or <), or run any other operation. This replaced most of my mouse-drag selections.

Shell
v character visual mode
V line visual mode
Ctrl+v block visual mode

14. :split and :vsplit — work on multiple files

These open a split window inside Vim. In VS Code with the extension, you'll probably use the editor's built-in split instead — but the Ctrl+w hjkl navigation between splits still works and it's worth knowing. It's one of those things that feels clunky until it's automatic.

Shell
:split horizontal split
:vsplit vertical split
:split utils.ts open specific file
Ctrl+w hjkl move between splits

15. :%s — find and replace across the whole file

This is the command that made me feel like Vim was designed for developers and not just sysadmins. :%s/oldName/newName/g replaces every occurrence in the file. Add c at the end to confirm each one. I use this for renaming variables during refactors constantly.

Shell
:%s/oldName/newName/g
:%s/console.log/logger.debug/gc

The combinations that feel like a different tool entirely

These are motions that take a few weeks to internalize but then become automatic. They're the reason experienced Vim users look impossibly fast to outsiders — they're not typing faster, they're just composing operations in a language the editor understands.

TEXT
ciw        → change entire word under cursor
ci"        → change text inside quotes
di(        → delete everything inside parentheses
yip        → copy current paragraph
5dd        → delete next 5 lines
.          → repeat last change (incredibly powerful)
*          → search for word under cursor

How I'd actually approach learning this

Install the VSCodeVim extension first — search 'Vim' in the VS Code extensions panel, it's the one by vscodevim with millions of installs. Then don't try to use every command on day one. Spend your first week just on navigation: hjkl, w, b, gg, G. Week two, add dd, yy, p, and u. Week three, start using / for search and :%s for find-and-replace. Let the rest come in naturally when you need it. The extension supports virtually everything in this list.

Did I end up switching to full Vim?

No — and I don't think I need to. The VSCodeVim extension gives me the motion model I wanted, and I keep all the things VS Code does well: IntelliSense, the debugger, Git integration, extensions for every framework I use. The week I spent obsessing over Vim wasn't wasted though. Learning the commands properly, even in an extension, changed how I edit code. I reach for the mouse a lot less. Refactoring feels faster. If you've been curious about Vim but don't want to abandon your editor, the extension is genuinely the right starting point.

VimVS CodeLinuxTerminalProductivityDeveloper Tools
Eissa Saber profile photo
Eissa Saber

Full Stack Developer with 6+ years building React, Next.js & Node.js applications. Available for full-time and contract roles.

Work with me