Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put [challenge ID]

Played Challenges

Simple, Practical, and Common - 33757 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 23
  • Position: #2461 / 7450
  • Number of attempts: 6
Just the middle - 11500 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 9
  • Position: #3230 / 4216
  • Number of attempts: 1
O Christmas Tree - 109 entries

Design a macro that makes trees grow (or ASCII triangles, if that's too hard).

  • Best score: 22
  • Best player score: 26
  • Position: #15 / 43
  • Number of attempts: 2
Condensed Cases - 807 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 15
  • Position: #151 / 248
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10699 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1634 / 3695
  • Number of attempts: 2
Words in parens - 12969 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2030 / 3970
  • Number of attempts: 1
Changing URL path in CSS - 139 entries

What's the quickest way to swap out all the URLs in a CSS file? Is it wasted keystrokes using look-behinds and look-aheads? (I'm sorry for the delete/report--I made a mistake with the last one requiring an ugly search for graphic to replace with images. I just intended this to be a simple search and replace that might possibly generate some macros or normals solutions that are quicker)

  • Best score: 40
  • Best player score: 40
  • Position: #5 / 63
  • Number of attempts: 2
Cleanining up 80 column concatenated text - 206 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

  • Best score: 31
  • Best player score: 39
  • Position: #35 / 80
  • Number of attempts: 2
Inconsistent real estate paste - 217 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

  • Best score: 24
  • Best player score: 42
  • Position: #39 / 59
  • Number of attempts: 1
Exchanging Quotes - 859 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 32
  • Position: #47 / 231
  • Number of attempts: 4
replacing each line of a block selection - 3005 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 21
  • Position: #341 / 779
  • Number of attempts: 1
Switch function arguments - 2152 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #10 / 667
  • Number of attempts: 3
Append semicolon after expressions - 1057 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #147 / 420
  • Number of attempts: 3
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 15
  • Position: #73 / 199
  • Number of attempts: 1
constructor - 182 entries

coding a constructor for a simple class

  • Best score: 59
  • Best player score: 125
  • Position: #45 / 60
  • Number of attempts: 4
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1052 / 1750
  • Number of attempts: 1
The meaning - 575 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #33 / 363
  • Number of attempts: 1
Ugly spreadsheet copy/paste to CSV - 1009 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 21
  • Position: #42 / 193
  • Number of attempts: 3
Simple text editing with Vim - 13095 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 14
  • Position: #1200 / 3767
  • Number of attempts: 2
Tibor Claassen
Twitter:

entered into 19 challenges

contributed 0 challenges