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 - 574 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: #75 / 204
  • Number of attempts: 1
Cartesian product - 210 entries

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

  • Best score: 24
  • Best player score: 128
  • Position: #88 / 90
  • Number of attempts: 1
replacing each line of a block selection - 2791 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #307 / 732
  • Number of attempts: 2
constructor - 165 entries

coding a constructor for a simple class

  • Best score: 59
  • Best player score: 143
  • Position: #48 / 56
  • Number of attempts: 1
switch variable - 4917 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #683 / 1701
  • Number of attempts: 2
Ugly spreadsheet copy/paste to CSV - 840 entries

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

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

Convert this tiny php class to adequate java one.

  • Best score: 65
  • Best player score: 96
  • Position: #32 / 60
  • Number of attempts: 1
Multiplication table. - 195 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 51
  • Position: #16 / 63
  • Number of attempts: 5
Sort the cardinal numbers - 280 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Position: #81 / 141
  • Number of attempts: 2
Make it more readable - 1891 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #132 / 622
  • Number of attempts: 3
remove dupes from array - 1290 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: #88 / 325
  • Number of attempts: 8
PHP <--> Java class conversion Part 2 - 84 entries

Same class but reverse!

  • Best score: 80
  • Best player score: 127
  • Position: #22 / 36
  • Number of attempts: 1
Alphabetize the directory - 269 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 30
  • Position: #4 / 97
  • Number of attempts: 6
PHP Array Syntax -> MailChimp Merge Syntax - 482 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: #87 / 143
  • Number of attempts: 5
Case preserving word replacement - 436 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 / 175
  • Number of attempts: 2
Sort entries based on date - 339 entries

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

  • Best score: 11
  • Best player score: 12
  • Position: #55 / 110
  • Number of attempts: 1
Happy New Year! - 139 entries

This is a simple new year's challenge.

  • Best score: 22
  • Best player score: 26
  • Position: #33 / 56
  • Number of attempts: 3
imports alignment (python) - 640 entries

Align as one import per line.

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

Use your super vim powers to generate Fibonacci Numbers.

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

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

  • Best score: 16
  • Best player score: 24
  • Position: #80 / 93
  • Number of attempts: 1
HTML to Haml - 800 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 27
  • Position: #28 / 197
  • Number of attempts: 6
Reformat long lines - 329 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: #58 / 129
  • Number of attempts: 2
Generate English Alphabets - 438 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 24
  • Position: #45 / 194
  • Number of attempts: 4
Overall Vimgolf Rank - 142 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: #23 / 56
  • Number of attempts: 2
Insert a Markdown link - 411 entries

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

  • Best score: 22
  • Best player score: 23
  • Position: #24 / 139
  • Number of attempts: 6
Getters & Setters: Java - 190 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: #40 / 54
  • Number of attempts: 1
The holy-grail may help - 315 entries

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

  • Best score: 16
  • Best player score: 19
  • Position: #176 / 194
  • Number of attempts: 1
Ruby 1.9 hashes - 1157 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 / 382
  • Number of attempts: 4
CSV to JSON - 144 entries

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

  • Best score: 56
  • Best player score: 84
  • Position: #18 / 60
  • Number of attempts: 6
Shebangs for all - 1771 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: #97 / 467
  • Number of attempts: 6
A Simple One - 924 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 / 612
  • Number of attempts: 2
Table Reshuffle - 349 entries

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

  • Best score: 22
  • Best player score: 23
  • Position: #13 / 127
  • Number of attempts: 7
Reverse and count - 412 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: #24 / 158
  • Number of attempts: 8
Ruby 1.9 compat - 590 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 / 225
  • Number of attempts: 1
Context insensitive completion 0 - 470 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: 7
  • Best player score: 7
  • Position: #48 / 222
  • Number of attempts: 3
Linear congruential generator - 108 entries

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

  • Best score: 28
  • Best player score: 30
  • Position: #15 / 46
  • Number of attempts: 3
Sort and add attributes - 1191 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #68 / 484
  • Number of attempts: 3
Reconstruct the Sentence - 1151 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 / 347
  • Number of attempts: 6
Whitespace, empty lines and tabs - 2980 entries

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

  • Best score: 16
  • Best player score: 19
  • Position: #143 / 664
  • Number of attempts: 6
Simple text editing with Vim - 11637 entries

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

  • Best score: 13
  • Best player score: 21
  • Position: #2650 / 3413
  • Number of attempts: 2
not so punk :]
Twitter:

entered into 40 challenges

contributed 0 challenges