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

Wrap the text of an email message to 79 characters - 705 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #94 / 398
  • Number of attempts: 1
Search and Replace 0 - 4851 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 12
  • Position: #146 / 1604
  • Number of attempts: 5
Python Hello World! Reformatting - 955 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 40
  • Position: #11 / 371
  • Number of attempts: 4
switch variable - 5045 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #10 / 1742
  • Number of attempts: 3
Ugly spreadsheet copy/paste to CSV - 978 entries

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

  • Best score: 19
  • Best player score: 23
  • Position: #59 / 188
  • Number of attempts: 3
Replacing some words - 420 entries

How fast could it be?

  • Best score: 17
  • Best player score: 18
  • Position: #34 / 149
  • Number of attempts: 2
Make it more readable - 1955 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #1 / 643
  • Number of attempts: 6
remove dupes from array - 1345 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 17
  • Position: #13 / 333
  • Number of attempts: 4
PHP Array Syntax -> MailChimp Merge Syntax - 508 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

  • Best score: 23
  • Best player score: 23
  • Position: #7 / 149
  • Number of attempts: 7
Case preserving word replacement - 454 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 19
  • Position: #36 / 180
  • Number of attempts: 3
Sort entries based on date - 364 entries

Sort some entries in a Ledger-file based on date.

  • Best score: 11
  • Best player score: 12
  • Position: #50 / 115
  • Number of attempts: 2
imports alignment (python) - 663 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 19
  • Position: #59 / 196
  • Number of attempts: 5
Rotating Philosophers Problem - 392 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

  • Best score: 29
  • Best player score: 30
  • Position: #68 / 165
  • Number of attempts: 2
HTML to Haml - 843 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 29
  • Position: #49 / 203
  • Number of attempts: 2
Generate English Alphabets - 476 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 25
  • Position: #111 / 205
  • Number of attempts: 1
Insert a Markdown link - 434 entries

Put a link in a markdown document, using the after-the-paragraph format.

  • Best score: 22
  • Best player score: 22
  • Position: #6 / 145
  • Number of attempts: 2
Numbering a List - 1869 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Position: #211 / 646
  • Number of attempts: 4
The holy-grail may help - 352 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 16
  • Position: #107 / 207
  • Number of attempts: 1
Ruby 1.9 hashes - 1225 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: 12
  • Best player score: 12
  • Position: #33 / 402
  • Number of attempts: 1
Assignment Alignment - 842 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 19
  • Position: #63 / 217
  • Number of attempts: 3
Shebangs for all - 1917 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 12
  • Position: #112 / 502
  • Number of attempts: 2
A Simple One - 1009 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #248 / 648
  • Number of attempts: 1
Reverse and count - 459 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 24
  • Position: #71 / 174
  • Number of attempts: 2
Ruby 1.9 compat - 610 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 14
  • Position: #25 / 230
  • Number of attempts: 2
Reverse Simple Deletion - 834 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #217 / 455
  • Number of attempts: 1
Sorting paragraphs - 510 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 24
  • Position: #40 / 159
  • Number of attempts: 3
Indentation - 499 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 20
  • Best player score: 23
  • Position: #21 / 170
  • Number of attempts: 2
The Cake is a Lie - 1301 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #114 / 517
  • Number of attempts: 1
Context Insensitive completion 1 - 471 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #79 / 237
  • Number of attempts: 1
Make Fancy Header - 1024 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #55 / 340
  • Number of attempts: 3
Reformat some Python - 590 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 34
  • Position: #16 / 233
  • Number of attempts: 2
Reformat most common surnames - 671 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 25
  • Position: #48 / 202
  • Number of attempts: 2
Change the content of a string - 1502 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #66 / 567
  • Number of attempts: 3
Sort and add attributes - 1369 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #87 / 542
  • Number of attempts: 2
Reconstruct the Sentence - 1436 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 20
  • Best player score: 20
  • Position: #39 / 397
  • Number of attempts: 4
Braces or Brackets? - 930 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 37
  • Position: #55 / 295
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3508 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #45 / 758
  • Number of attempts: 5
Flodder-challenge - 1176 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 29
  • Position: #73 / 321
  • Number of attempts: 5
Simple text editing with Vim - 12491 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #44 / 3626
  • Number of attempts: 7
Reformat/Refactor a Golfer Class - 6749 entries

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

  • Best score: 31
  • Best player score: 32
  • Position: #2 / 1652
  • Number of attempts: 5
Pei-Lun Lee
Twitter:

entered into 40 challenges

contributed 0 challenges