Edit Faster: Vim Motions From Scratch


Edit Faster: Vim Motions From Scratch

Ever watched a developer frantically switching between keyboard and mouse? "Click, type, click, type..." It's like watching someone crawl when they could just walk.

If you're tired of granny mode coding and want to boost your productivity, Vim motions might be exactly what you need.

Every once in a while, I review my processes, trying to improve systems, tools, and yes, motions.
This time I thought, why not share the basics with everyone too?

These motions aren't just for Vim users, but for anyone using a modern code editor like VS Code or PyCharm.

These shortcuts aren't just convenient; they're a language that makes coding (or any text for that matter) significantly faster.

Once you start using them, they'll become second nature, and you'll wonder how you ever coded without them. You'll start searching them everywhere: in your notes app, docs and Slack.

The core problem is simple: context switching between keyboard and mouse kills productivity.

Forcing the fingers to stay on the keyboard, without proper motions, usually means a lot of repeated arrow key strokes. And if there's something that feels like cutting brain connections when I code, it must be hitting the arrow 15 times to change a line or the cursor location on a line of code.

Most developers accept this inefficiency as normal, endlessly reaching for their mouse to navigate code.

"Steep learning curve" They'd say, or "I'd end up spending more time learning these instead of producing lines of code". I know that, because I've said the exact same things to my mentor 12 years ago.

There's nothing further from the truth, yes, Vim is HARD to learn, but not THAT HARD.

In fact, if you read through, and practice just the list in this document, you'll be able to conveniently edit any Vim files on any machine. Kind of like speaking the "street language" of a country you're visiting on your next vacation.

By mastering Vim motions, you can keep your hands on the keyboard and dramatically speed up your workflow.

Vim offers an intuitive movement language centered around the home row keys.

Start with h, j, k, and l for basic navigation (left, down, up, right).

Once comfortable, expand to faster movements: w jumps to the next word's start, e to a word's end, and b moves backward.

Need to find a specific character? Use f followed by the target letter.

For editing, the story gets even better.

Once in normal mode (access via Escape), d deletes, y yanks (copies), and p pastes.

Combine these with movements like dw to delete a word or dd to delete a line.

The "dot" (`.`) operator repeats your last action, making bulk edits remarkably efficient.

Here's a list of the basics:

Navigation: h (left), j (down), k (up), l (right)

Word movement: w (next word start), e (word end), b (backward)

Line navigation: 0 (line start), ^ (first non-space character), $ (line end)

Character finding: f{char} (find forward), F{char} (find backward), ; (repeat find), , (reverse find)

Document navigation: gg (document top), G (document bottom), {n}G (goto line n)

Screen navigation: zz (center current line), H (screen top), M (screen middle), L (screen bottom)

Editing: i (insert), a (append), o (new line below), O (new line above)

Deletion: d{motion}, dd (delete line), D (delete to line end)

Copy/paste: y{motion}, yy (yank line), p (paste after), P (paste before)

Visual selection: v (character mode), V (line mode), Ctrl+v (block mode)

Text objects: diw (delete in word), ci" (change in quotes)

Search: /pattern (search forward), ?pattern (search backward), n (next match), N (previous match)

Undo/Redo: u (undo), Ctrl+r (redo)

Saving/Quitting: :w (save), :q (quit), :wq or ZZ (save and quit)

One clever tweak is remapping the Escape key for easier mode switching.

I suggest adding a custom mapping for jj or jk in your Vim configuration:

This eliminates the need to reach for the Escape key, keeping your fingers on the home row.

To improve your Vim motion control, try Vim Adventures: A game specifically designed to teach Vim navigation through solving mazes using hjkl keys

Vim Golf: Challenges that push you to complete editing tasks with the fewest keystrokes possible

"Vim motions aren't just keys, they're a language. A language so easy on your fingers that you won't just set them up everywhere — they'll become something you can't live without."

Ready to make the keyboard cool again? Start small with basic navigation, practice daily, and gradually add new motions to your repertoire.

Within weeks, you'll find yourself editing text at the speed of thought, leaving mouse-dependent developers in the dust, then, you'd probably want to start watching this.


Thank you for reading.
Feel free to reply directly with any question or feedback.
Have a great weekend!

ESPRESSO FRIDAYS

Every once in a while I send hand picked things I've learned. Kind of like your filter to the tech internet. No spam, I promise!

Read more from ESPRESSO FRIDAYS

The Most LOVED Server On The Planet This issue is brought to you by: Reliable DNS hosting & domain name managementWith DNSimple! From a streamlined interface to single-click integrations, DNSimple delivers the tools you need to simplify your day. Developers and system admins love our single-click integrations and automation tools for domains, DNS, and more. Enterprise teams simplify management of the most complex domain environments through our NEW Domain Control Plane. Try FREE for 30 days!...

This Nginx Fork Should Be Illegal This issue is brought to you by: Trigger.dev: The open source platform to build and deploy fully‑managed AI agents and workflows Trigger.dev is the platform for building AI workflows in TypeScript. Long-running tasks with retries, queues, observability, and elastic scaling. Start Building Now Look, we all love Nginx. I've used it for years. It’s the reliable, rock-solid engine that’s kept my infra running since the early days. But every once in a while, it’s...

I Was DEFINITELY Using The Wrong Dev Env CLI This issue is brought to you by: Teleport: Unified Identity Securing Classic & AI Infrastructure Teleport unifies identities — humans, machines, and AI — with strong identity implementation to speed up engineering, improve resiliency against identity-based attacks, and secure AI in production infrastructure. Try Teleport for Free I titled this newsletter like I did because I realized my old setup was a fragmented mess of five different tools when...