Mission 09 / 52• Essential Motions

Moving by WORDs

Vim has two definitions of a word: a regular word (letters, digits, underscores) and a WORD (anything separated strictly by whitespace).

When editing code with dots, dashes, parentheses, and punctuation, uppercase `W`, `E`, and `B` leap over entire compound tokens in a single bound.

WORD motions

  • Wjump forward to the start of the next whitespace-delimited WORD
  • Ejump forward to the end of the current or next WORD
  • Bjump backward to the start of the previous WORD
1
import { getAuthToken } from "@/lib/auth/session-token";
2
const url = "https://api.vimactualhero.dev/v1/lessons?sort=asc";
3
const res = await client.request(url, { headers });

Compare `w` and `W` on the URL: `w` stops at every quote, slash, colon, question mark, and equals sign. `W` skips the entire URL in one leap.

Use `B` to jump back past entire path segments with minimal keystrokes.

Now it's your turn!

  1. Navigate to each green target across the code snippet.
  2. Use the motions and techniques learned in this lesson to land accurately on each target.
  3. See how fast you can complete 10 targets.
0/10
1
import { getAuthToken } from "@/lib/auth/session-token";
2
const url = "https://api.vimactualhero.dev/v1/lessons?sort=asc";
3
const res = await client.request(url, { headers });
NORMAL
00:00