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

Cleanining up 80 column concatenated text - 184 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: 45
  • 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: 45
  • Number of attempts: 1
Dehamlizing - 155 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 42
  • Number of attempts: 1
Alphabetize the directory - 252 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 41
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 5527 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 39
  • Number of attempts: 2
Reverse and double space - 408 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 17
  • Number of attempts: 2
constructor - 162 entries

coding a constructor for a simple class

  • Best score: 59
  • Best player score: 126
  • Number of attempts: 1
Vertical Limit - 2126 entries

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

  • Best score: 21
  • Best player score: 26
  • Number of attempts: 2
Format the output - 95 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: 47
  • Number of attempts: 2
Exchanging Quotes - 761 entries

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

  • Best score: 30
  • Best player score: 38
  • Number of attempts: 1
Simple text editing with Vim - 10544 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 2
Readable Rubyhash - 232 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 23
  • Best player score: 29
  • Number of attempts: 2
Switch function arguments - 1843 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Complete the circuit grid! - 72 entries

Continuing from the last challenge, add additional rows to the grid. Change each of the names from 'A1'...'A10' to 'B1'...'B10', 'C1'...'C10', etc, and for each new row add 0.7 to the X values in the (X Y) at the end of each line.

  • Best score: 49
  • Best player score: 79
  • Number of attempts: 1
The meaning - 502 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
replacing each line of a block selection - 2545 entries

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

  • Best score: 18
  • Best player score: 21
  • Number of attempts: 1
Remove noise from HTTP log - 611 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
  • Number of attempts: 3
you're stuck on jQuery < 1.7 - 317 entries

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

  • Best score: 25
  • Best player score: 29
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1294 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 9
  • Number of attempts: 1
Line Zipper - 397 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 330 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 3
HTML to Haml - 722 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 38
  • Number of attempts: 2
Append semicolon after expressions - 869 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Python to Ruby - 188 entries

Convert this Python code to Ruby. NOTE: This program likely won't run.

  • Best score: 24
  • Best player score: 44
  • Number of attempts: 1
Generate English Alphabets - 413 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 42
  • Number of attempts: 1
Aligning function arguments to match a specific coding style - 159 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: 24
  • Number of attempts: 1
Whitespace, empty lines and tabs - 2557 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 28
  • Number of attempts: 1
Convert pandoc unordered list to a numbered list - 131 entries

I know it's possible to use #. in pandoc to auto-generate numbered lists, but then it's not easy to tell how many items there are when reading it in Markdown. How fast can you make the switch?

  • Best score: 20
  • Best player score: 28
  • Number of attempts: 1
SFD-ROC: ASCII Logo Border - 66 entries

Draw a border around this familiar logo ;)

  • Best score: 20
  • Best player score: 29
  • Number of attempts: 1
switch variable - 4345 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 1
Make the circuit grid! - 71 entries

Copy this command for a circuit layout program to create 10 total smd commands. Increment the number in quotes to name each pad, and add 0.7 to each of the (X Y) coordinates at the end of each line.

  • Best score: 26
  • Best player score: 35
  • Number of attempts: 1
Ugly spreadsheet copy/paste to CSV - 731 entries

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

  • Best score: 19
  • Best player score: 36
  • Number of attempts: 2
Glen
Twitter:

やりたいことがありすぎるんだよねー

entered into 32 challenges

contributed 0 challenges