Learn Vim / Up to, not including — vim

Up to, not including — vim

The answerCanonical keystrokes: ct: NewName Esc.

Try it on a real buffer

Rename the label before the colon. With the cursor at the start of line 1, change up to (but not including) the colon with ct:, then type NewName and Esc.

OldName: keep this description intact

Canonical solution: ct: NewName Esc · par: 11 keystrokes (vimgolf rules — every keypress counts).

Why it works

t{char} stops just BEFORE the character; f{char} lands ON it. So ct: changes up to the colon (leaving it), while cf: would eat the colon too. dt, ct, yt — “till” is the surgeon's version of “find”.

Reading about keystrokes doesn't build keystrokes. Try this in a real vim buffer right now — the “Up to, not including” mission takes about a minute.

Practice free — no signup →

Keep going