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 - 340 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 43
  • Position: #43 / 100
  • Number of attempts: 1
Changing URL path in CSS - 123 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 / 57
  • Number of attempts: 2
Create a pandoc compatible table - 179 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: #43 / 52
  • Number of attempts: 1
Shuffle and Sort - 201 entries

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

  • Best score: 17
  • Best player score: 29
  • Position: #53 / 63
  • Number of attempts: 2
Cleanining up 80 column concatenated text - 186 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: #29 / 75
  • Number of attempts: 3
you're stuck on jQuery < 1.7 - 335 entries

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

  • Best score: 25
  • Best player score: 32
  • Position: #73 / 110
  • Number of attempts: 1
Inconsistent real estate paste - 179 entries

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

  • Best score: 24
  • Best player score: 43
  • Position: #37 / 54
  • Number of attempts: 1
Vertical Limit - 2409 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #177 / 730
  • Number of attempts: 3
Aligning function arguments to match a specific coding style - 218 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: #29 / 66
  • Number of attempts: 4
Exchanging Quotes - 801 entries

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

  • Best score: 30
  • Best player score: 48
  • Position: #208 / 221
  • Number of attempts: 3
replacing each line of a block selection - 2912 entries

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

  • Best score: 18
  • Best player score: 25
  • Position: #517 / 761
  • Number of attempts: 2
Switch function arguments - 2035 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 15
  • Position: #504 / 641
  • Number of attempts: 2
Append semicolon after expressions - 995 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #147 / 399
  • Number of attempts: 2
Reverse and double space - 475 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Position: #25 / 191
  • Number of attempts: 3
Remove noise from HTTP log - 677 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: #145 / 267
  • Number of attempts: 2
Remove semicolons after expressions - 607 entries

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

  • Best score: 6
  • Best player score: 8
  • Position: #148 / 254
  • Number of attempts: 3
switch variable - 5016 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1290 / 1729
  • Number of attempts: 3
Format the output - 143 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: #29 / 38
  • Number of attempts: 3
Calculate the table totals - 129 entries

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

  • Best score: 33
  • Best player score: 78
  • Position: #35 / 42
  • Number of attempts: 1
Sort and add attributes - 1287 entries

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

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

entered into 20 challenges

contributed 0 challenges