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

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: 68
  • Position: #53 / 57
  • Number of attempts: 1
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: 65
  • Position: #72 / 74
  • Number of attempts: 3
Inconsistent real estate paste - 178 entries

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

  • Best score: 24
  • Best player score: 52
  • Position: #45 / 53
  • Number of attempts: 1
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: 17
  • Position: #20 / 66
  • Number of attempts: 1
Exchanging Quotes - 801 entries

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

  • Best score: 30
  • Best player score: 33
  • Position: #68 / 221
  • Number of attempts: 12
Switch function arguments - 2019 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #20 / 637
  • Number of attempts: 5
Append semicolon after expressions - 986 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #10 / 397
  • Number of attempts: 5
Remove noise from HTTP log - 675 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: 15
  • Position: #26 / 266
  • Number of attempts: 6
Remove semicolons after expressions - 602 entries

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

  • Best score: 6
  • Best player score: 6
  • Position: #20 / 253
  • Number of attempts: 1
The meaning - 543 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #109 / 350
  • Number of attempts: 1

Contributed Challenges

Inconsistent real estate paste - 178 entries

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

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

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)

Ryan O'Connell
Twitter:

entered into 10 challenges

contributed 3 challenges