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

Interweave two blocks of text - 641 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 17
  • Position: #81 / 212
  • Number of attempts: 1
Cartesian product - 222 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 128
  • Position: #91 / 93
  • Number of attempts: 1
replacing each line of a block selection - 2966 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #324 / 772
  • Number of attempts: 2
constructor - 181 entries

coding a constructor for a simple class

  • Best score: 59
  • Best player score: 143
  • Position: #51 / 59
  • Number of attempts: 1
switch variable - 5045 entries

how fast can you switch two variable ?

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

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

  • Best score: 19
  • Best player score: 22
  • Position: #54 / 188
  • Number of attempts: 5
PHP <--> Java class conversion Part 1 - 213 entries

Convert this tiny php class to adequate java one.

  • Best score: 65
  • Best player score: 96
  • Position: #34 / 62
  • Number of attempts: 1
Multiplication table. - 206 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 51
  • Position: #17 / 64
  • Number of attempts: 5
Sort the cardinal numbers - 294 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Position: #85 / 147
  • 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: 14
  • Position: #137 / 643
  • Number of attempts: 3
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: 18
  • Position: #93 / 333
  • Number of attempts: 8
PHP <--> Java class conversion Part 2 - 97 entries

Same class but reverse!

  • Best score: 80
  • Best player score: 127
  • Position: #24 / 39
  • Number of attempts: 1
Alphabetize the directory - 284 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 30
  • Position: #4 / 100
  • Number of attempts: 6
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: 34
  • Position: #89 / 149
  • Number of attempts: 5
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: #15 / 180
  • Number of attempts: 2
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: #57 / 115
  • Number of attempts: 1
Happy New Year! - 144 entries

This is a simple new year's challenge.

  • Best score: 22
  • Best player score: 26
  • Position: #34 / 58
  • Number of attempts: 3
imports alignment (python) - 663 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Position: #19 / 196
  • Number of attempts: 6
Generate Fibonacci Numbers - 263 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 25
  • Position: #78 / 98
  • Number of attempts: 2
It'ss tooo coold too typpe todaay - 222 entries

My hands are numb with cold. It's hard to type correctly.

  • Best score: 16
  • Best player score: 24
  • Position: #84 / 97
  • Number of attempts: 1
HTML to Haml - 843 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 27
  • Position: #30 / 203
  • Number of attempts: 6
Reformat long lines - 346 entries

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

  • Best score: 15
  • Best player score: 17
  • Position: #60 / 133
  • Number of attempts: 2
Generate English Alphabets - 476 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 24
  • Position: #50 / 205
  • Number of attempts: 4
Overall Vimgolf Rank - 171 entries

Suppose you are trying to figure out what your overall rank is at Vimgolf(the sum of all the ranks you got), and as a Vim ninja you decided to use Vim to do the job. Your solution should work for every Vimgolf profile page(The actual input file for this challenge is my Vimgolf profile page). So, direct answer insertion is considered cheating.

  • Best score: 23
  • Best player score: 25
  • Position: #25 / 58
  • Number of attempts: 2
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: 23
  • Position: #27 / 145
  • Number of attempts: 6
Getters & Setters: Java - 206 entries

Boilerplate getters & setters - it's a tedious fact of life in Java, and probably the only thing that still pulls me back to an IDE. Perhaps someone knows a fast, pure vim way...

  • Best score: 89
  • Best player score: 133
  • Position: #43 / 57
  • Number of attempts: 1
The holy-grail may help - 352 entries

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

  • Best score: 16
  • Best player score: 19
  • Position: #186 / 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: #24 / 402
  • Number of attempts: 4
CSV to JSON - 173 entries

A search for shortest vimissh way to convert CSV to JSON.

  • Best score: 56
  • Best player score: 84
  • Position: #20 / 66
  • Number of attempts: 6
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: #104 / 502
  • Number of attempts: 6
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: #205 / 648
  • Number of attempts: 2
Table Reshuffle - 372 entries

Fix the column order in this table... also append the new 'username' column.

  • Best score: 22
  • Best player score: 23
  • Position: #13 / 135
  • Number of attempts: 7
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: 22
  • Position: #34 / 174
  • Number of attempts: 8
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: #20 / 230
  • Number of attempts: 1
Context insensitive completion 0 - 545 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 7
  • Position: #52 / 239
  • Number of attempts: 3
Linear congruential generator - 132 entries

http://en.wikipedia.org/wiki/Linear_congruential_generator

  • Best score: 28
  • Best player score: 30
  • Position: #18 / 51
  • 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: #68 / 542
  • Number of attempts: 3
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: #21 / 397
  • Number of attempts: 6
Whitespace, empty lines and tabs - 3508 entries

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

  • Best score: 16
  • Best player score: 19
  • Position: #182 / 758
  • Number of attempts: 6
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: 21
  • Position: #2800 / 3626
  • Number of attempts: 2
not so punk :]
Twitter:

entered into 40 challenges

contributed 0 challenges