Vim golf Challenges Transform the start text into the goal with real Vim keystrokes. Race the clock, then beat par — the fewest keys possible.
beginner Delete the word "broken". par 2 Join the two lines into one. par 1 Add a semicolon at the end of the line. par 3 Remove the extra l. par 1 Delete from the cursor to the end of the line. par 1 Add a second line that reads "second". par 8 Turn cat into bat. par 2 Capitalize the first letter. par 1 Fix the transposed letters: teh → the. par 2 Duplicate the first line. par 3 Comment the line by adding "# " at the front. par 4 Delete the junk line. par 2 Delete the three leading x’s with a count. par 2 Shout the first word with a count: abc → ABC. par 2 Add a line "first" ABOVE. par 7 Fix cat → cap. par 2
intermediate Change the text inside the quotes to "new". par 7 Empty the parentheses. par 3 Delete the word "bar" and its space. par 3 Delete up to (not including) the first semicolon. par 3 Delete everything through the X. par 3 Change the array index to "new". par 7 Swap the two lines (move line 1 below line 2). par 3 Rename the first word to "begin". par 9 Remove the shouting word. par 3 Change the argument to y. par 5 Delete the parentheses and their contents. par 3 Shout the first word: hello → HELLO. par 5 Delete the first two words. par 3 Delete the two top lines. par 3 Change the first word to XYZ. par 6 Empty the string. par 3 Delete the whole {block} including braces. par 3 Strip the leading a’s with x then dots. par 3 Select the first word with v + e and delete it. par 3
advanced Search for "target" and delete it. par 10 Replace cat with dog. par 12 Replace every x with y on this line. par 9 Rename foo to bar on every line. par 14 Add a semicolon to all three lines (record once, replay). par 11 Jump to the next "sum" and delete it. par 3 Change the value after the colon to "done". par 6 Rewrite the whole line as "clean". par 8 Delete the two top lines, keeping only the last. par 3 Join all three lines into one (with a count). par 2 Empty the object body and write "x: 1". par 8 Add a trailing comma to the array item. par 3 Replace every dash with an underscore. par 9 Find the SECOND "cat" and delete it. par 7