Files
Hugo/content/blog/vim-motions.md
T
2026-05-13 16:35:54 +08:00

51 lines
1.8 KiB
Markdown

---
title: "Vim Motions That Actually Save Time"
date: 2026-05-14T14:00:00+08:00
draft: false
tags:
- Vim
- Productivity
- Editor
---
Everyone tells you to learn Vim, but nobody tells you *which* motions are worth the muscle memory investment. After three years of daily use, here's my honest ranking.
## Tier 1: Non-Negotiable
These pay for themselves within a week:
| Motion | What it does | Why it matters |
|--------|-------------|----------------|
| `ci"` | Change inside quotes | Editing strings, attributes |
| `ci(` / `ci{` | Change inside brackets | Refactoring arguments |
| `%` | Jump to matching bracket | Navigating code blocks |
| `*` / `#` | Search word under cursor | Quick variable tracing |
| `.` | Repeat last change | The single biggest time-saver |
## Tier 2: Worth Practicing
These take a few weeks to internalize but compound:
- `f{char}` / `F{char}` — find character inline. Faster than `h`/`l` spam
- `t{char}` / `T{char}` — find *until* character. Perfect for deleting `until` a comma
- `ctrl+d` / `ctrl+u` — half-page scroll. Keeps your eyes on the same spot
- `zz` — center current line. Eliminates mental reorientation
## Tier 3: Nice to Have
Useful but not essential for daily work:
- `gt` / `gT` — switch tabs
- `ctrl+o` / `ctrl+i` — jump back/forward in the jumplist
- Macros (`q{register}`) — only worth it for repetitive tasks of 10+ iterations
## What I Don't Use
- **Line numbers as targets** (`:42`) — too slow mentally
- **Visual block mode** — I use multi-cursor in VS Code instead
- **`/` search with regex** — I just use `*` and `f` 90% of the time
---
The real productivity gain isn't in any single motion — it's in **not thinking about navigation**. When your fingers just move the cursor without conscious effort, that's when the payoff arrives.