Step 5 of 5

Two-character jump labels

Two-character jump labels

Every jump so far needed a destination you could name: a line number, a search pattern. Often the place you want is just a word you can see. For that there is one more goto-mode command:

  • gw — jump to a word on screen by typing its two-character label

Press gw and every word in view is overlaid with a two-letter label. Type those two letters and the cursor jumps to that word; press any other key to cancel. The labels are assigned fresh on every press — words near the cursor get the earliest letters — so read them off the screen rather than trying to remember them.

Only what’s currently visible gets a label, and very short words are skipped, but two keystrokes plus a label reach almost anywhere on screen without counting lines or typing a search.

One honest note: in current Helix a label jump records a jumplist entry like any other jump, but the build in this embedded editor predates that, so Ctrl-o won’t bring you back from one here.

The checklist below has you hop around the file with nothing but gw.

  1. Jump to a word on line 10 Press gw, then type the two-character label shown on any word of line 10.
  2. Jump to a word on line 20 gw again — the labels reshuffle around your new position — then the label on a word of line 20.
  3. Jump back up to line 10 One more gw — read the labels fresh and pick a word on line 10.
Jump to a word on line 10 Press gw, then type the two-character label shown on any word of line 10.

Next: Jump to a word on line 20

Loading editor…