Learn Practice Daily golf Reference
Daily golf

Vim golf

Each hole is a small editing job: a start text, a target, and a par. Make the text match in as few keystrokes as you can. Every key counts, Esc and Enter too, in a real Vim editor in your browser. (How it compares with other ways to play: Vim games.)

Play today's hole A new one opens every day at midnight UTC; the browser extension brings it to your toolbar.

How Vim golf works

Par

Par is the length of a known good solution. Beat it, and you've found a shorter way than ours. The Vim course teaches every key you need.

The share card

Finish a hole and you get one coloured square per keystroke: motions, operators, counts, typed text, the command line and Esc.

After you solve it

The par solution and the day's leaderboard open up, so you can see the keys that beat you.

All 60 holes

  1. Warm-up par 4 Delete the three middle lines.
  2. Rename everywhere par 9 Rename the variable a to x. Leave every other letter alone.
  3. Wrap it par 15 Round the total by wrapping the expression in round(...).
  4. Object shorthand par 16 Turn the three names into one object literal on a single line.
  5. Checklist par 11 Turn the lines into a Markdown checklist.
  6. Semicolon sweep par 10 Add a semicolon to the end of every line.
  7. Constant case par 15 Rename maxRetries to MAX_RETRIES.
  8. Transposed par 4 Someone typed the tax rate in a hurry. It should be 0.0875.
  9. Bring the heat par 9 The Garden Veggie got its jalapeños back. Mark it spicy.
  10. Open late par 1 Friday: the kitchen closes an hour later.
  11. Happy hour, shifted par 3 Happy hour moves an hour later: 17 becomes 18, 19 becomes 20.
  12. Nobody faxes par 3 The fax ordering line was switched off in 2020. Delete the function and its comment.
  13. Rider, now courier par 14 Legal says they're couriers now. Rename rider (not riders) everywhere.
  14. Quote the menu par 12 Turn the menu ids into a list of quoted strings, one per line, each with a comma.
  15. Tidy the ticket par 3 The kitchen ticket's body lost its indent. Put it back.
  16. Empty the cart par 3 The order was cancelled. Empty the cart object.
  17. Wrong way round par 3 You can't return before you've marked it delivered.
  18. Closing time par 20 Add the closing hour under the opening hour: const CLOSE_HOUR = 23;.
  19. Quiet, please par 13 Remove every console.log line before the noon rush.
  20. Alphabetical par 6 The printed menu has to be in alphabetical order.
  21. Seen it par 8 The export doubled some orders. Sort the ids and drop the duplicates.
  22. Inside voice par 4 The label is shouting. Make it lowercase.
  23. Proper names par 3 Capitalise both words of the dish.
  24. A heading par 4 The README's first line should be a Markdown heading.
  25. Number the steps par 12 Number the folding instructions 1 to 4.
  26. Burrito 2.0 par 15 Launch week: the page title becomes Burrito 2.0.
  27. It's Friday par 4 The TODO said "before Friday". It's Friday.
  28. Top billing par 5 The birria sells out first. Move it to the top of the list.
  29. Shorter names par 8 Call it with a, b instead.
  30. No retries par 6 Texts don't retry any more. Drop the last argument.
  31. One per line par 5 Two statements, two lines.
  32. Debugger sweep par 7 Three debugger; lines made it into the kitchen display. Delete them.
  33. Four lines of junk par 4 Delete the four lines between the keepers.
  34. Quote it par 8 Hello is a string. Put it in double quotes.
  35. Export them all par 12 Export all three functions.
  36. Not today par 8 Comment out the three delivery lines.
  37. Back on par 6 Uncomment the three lines.
  38. Drop a column par 5 The accountant doesn't want the qty column. Delete it, comma and all.
  39. New link par 10 The menu link should go to /order.
  40. Squeeze par 8 Remove the blank lines from the rider list.
  41. Number the orders par 5 Number the orders 1 to 4.
  42. Kebab case par 4 Ids use dashes, not spaces.
  43. Allergen update par 4 The Garden Veggie no longer has nuts. Drop the note.
  44. Rush hour par 2 Add seven minutes to the ETA.
  45. Smaller tip par 2 The default tip goes down by five.
  46. Fire the grill par 18 Turn each dish into a cook("…"); call.
  47. Line seven par 4 Line 7 has to go.
  48. Fax hunt par 7 Somewhere in here is one more fax call. Delete its line.
  49. Extra spicy par 11 Make it Al Pastor (spicy), inside the quotes.
  50. Fire par 3 Make the warning impossible to miss.
  51. Everyone's off par 3 Empty the riders array.
  52. Same again par 5 b should be "taco" too.
  53. Way, way par 5 Remove the doubled word.
  54. I before E par 4 Fix the spelling.
  55. Please, please par 3 One please is enough. Actually, none is.
  56. Last in, first out par 8 Reverse the order of the lines.
  57. Three digits par 6 Order ids have three digits now.
  58. One line will do par 1 Join the statement onto one line.
  59. Commas, not semicolons par 8 It's a list, not statements.
  60. Last orders par 4 The kitchen can only make three more tonight. Delete every order after the third.