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 - 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: 68
  • Position: #52 / 56
  • 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 - 159 entries

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

  • Best score: 24
  • Best player score: 52
  • Position: #42 / 51
  • Number of attempts: 1
Aligning function arguments to match a specific coding style - 189 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: #17 / 63
  • Number of attempts: 1
Exchanging Quotes - 781 entries

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

  • Best score: 30
  • Best player score: 33
  • Position: #65 / 216
  • Number of attempts: 12
Switch function arguments - 1945 entries

How to switch two arguments of a function.

  • Best score: 3
  • Best player score: 11
  • Position: #21 / 618
  • Number of attempts: 5
Append semicolon after expressions - 923 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #10 / 375
  • Number of attempts: 5
Remove noise from HTTP log - 653 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 / 256
  • Number of attempts: 6
Remove semicolons after expressions - 511 entries

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

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

Numbers are fun!

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

Contributed Challenges

Inconsistent real estate paste - 159 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 - 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)

Ryan O'Connell
Twitter:

entered into 10 challenges

contributed 3 challenges