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

Prime Numbers - 303 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 43
  • Position: #35 / 91
  • Number of attempts: 1
Changing URL path in CSS - 113 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: #8 / 56
  • Number of attempts: 2
Create a pandoc compatible table - 164 entries

In [this vimcast][1], a featured gist from Tim Pope shows how to quickly make a simple table structure. How fast can you convert it to pandoc's markdown style? [1]: http://vimcasts.org/episodes/aligning-text-with-tabular-vim/

  • Best score: 32
  • Best player score: 57
  • Position: #40 / 49
  • Number of attempts: 1
Shuffle and Sort - 172 entries

The values where sorted incorrectly. Get them back to how they are supposed to be

  • Best score: 17
  • Best player score: 29
  • Position: #49 / 59
  • Number of attempts: 2
Cleanining up 80 column concatenated text - 185 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: 35
  • Position: #28 / 74
  • Number of attempts: 3
you're stuck on jQuery < 1.7 - 325 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

  • Best score: 25
  • Best player score: 32
  • Position: #69 / 104
  • Number of attempts: 1
Inconsistent real estate paste - 159 entries

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

  • Best score: 24
  • Best player score: 43
  • Position: #35 / 51
  • Number of attempts: 1
Vertical Limit - 2300 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 23
  • Position: #168 / 701
  • Number of attempts: 3
Aligning function arguments to match a specific coding style - 181 entries

Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.

  • Best score: 16
  • Best player score: 18
  • Position: #25 / 62
  • Number of attempts: 4
Exchanging Quotes - 781 entries

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

  • Best score: 30
  • Best player score: 48
  • Position: #204 / 216
  • Number of attempts: 3
replacing each line of a block selection - 2740 entries

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

  • Best score: 18
  • Best player score: 25
  • Position: #496 / 724
  • Number of attempts: 2
Switch function arguments - 1933 entries

How to switch two arguments of a function.

  • Best score: 3
  • Best player score: 15
  • Position: #483 / 617
  • Number of attempts: 2
Append semicolon after expressions - 912 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #137 / 374
  • Number of attempts: 2
Reverse and double space - 433 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Position: #25 / 179
  • Number of attempts: 3
Remove noise from HTTP log - 641 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 16
  • Position: #137 / 255
  • Number of attempts: 2
Remove semicolons after expressions - 511 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 8
  • Position: #128 / 225
  • Number of attempts: 3
switch variable - 4863 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1255 / 1688
  • Number of attempts: 3
Format the output - 102 entries

Sometimes your standard out is a little hard to read. Take this multilevel hash and make it human readable.

  • Best score: 35
  • Best player score: 69
  • Position: #25 / 34
  • Number of attempts: 3
Calculate the table totals - 107 entries

Go ahead... commit the treachery of using vim as a spreadsheet.

  • Best score: 33
  • Best player score: 78
  • Position: #32 / 39
  • Number of attempts: 1
Sort and add attributes - 1115 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 33
  • Position: #104 / 458
  • Number of attempts: 4
John Whitley
Twitter:

entered into 20 challenges

contributed 0 challenges