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

constructor - 161 entries

coding a constructor for a simple class

  • Best score: 59
  • Best player score: 143
  • Number of attempts: 1
Cartesian product - 201 entries

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

  • Best score: 24
  • Best player score: 128
  • Number of attempts: 1
PHP <--> Java class conversion Part 2 - 83 entries

Same class but reverse!

  • Best score: 80
  • Best player score: 127
  • Number of attempts: 1
PHP <--> Java class conversion Part 1 - 178 entries

Convert this tiny php class to adequate java one.

  • Best score: 65
  • Best player score: 96
  • Number of attempts: 1
CSV to JSON - 143 entries

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

  • Best score: 56
  • Best player score: 84
  • Number of attempts: 6
Multiplication table. - 171 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 51
  • Number of attempts: 5
PHP Array Syntax -> MailChimp Merge Syntax - 421 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
  • Number of attempts: 5
Sort and add attributes - 1082 entries

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

  • Best score: 33
  • Best player score: 33
  • Number of attempts: 3
Alphabetize the directory - 252 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 30
  • Number of attempts: 6
HTML to Haml - 719 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 27
  • Number of attempts: 6
Overall Vimgolf Rank - 132 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
  • Number of attempts: 2
Generate Fibonacci Numbers - 200 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 25
  • Number of attempts: 2
Generate English Alphabets - 400 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 24
  • Number of attempts: 4
Insert a Markdown link - 385 entries

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

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 6
Make it more readable - 1755 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
remove dupes from array - 1190 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
  • Number of attempts: 8
Ruby 1.9 compat - 557 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
  • Number of attempts: 1
Context insensitive completion 0 - 444 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
  • Number of attempts: 3
Shebangs for all - 1588 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
  • Number of attempts: 6
switch variable - 4301 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Sort the cardinal numbers - 215 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 2
A Simple One - 840 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
  • Number of attempts: 2
Reconstruct the Sentence - 1024 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
  • Number of attempts: 6
Ruby 1.9 hashes - 1069 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
  • Number of attempts: 4
Linear congruential generator - 104 entries

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

  • Best score: 28
  • Best player score: 30
  • Number of attempts: 3
Interweave two blocks of text - 486 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
  • Number of attempts: 1
Simple text editing with Vim - 10385 entries

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

  • Best score: 13
  • Best player score: 21
  • Number of attempts: 2
Sort entries based on date - 304 entries

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

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Whitespace, empty lines and tabs - 2541 entries

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

  • Best score: 16
  • Best player score: 19
  • Number of attempts: 6
Happy New Year! - 129 entries

This is a simple new year's challenge.

  • Best score: 22
  • Best player score: 26
  • Number of attempts: 3
Ugly spreadsheet copy/paste to CSV - 725 entries

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

  • Best score: 19
  • Best player score: 22
  • Number of attempts: 5
The holy-grail may help - 301 entries

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

  • Best score: 16
  • Best player score: 19
  • Number of attempts: 1
Case preserving word replacement - 385 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
  • Number of attempts: 2
replacing each line of a block selection - 2508 entries

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

  • Best score: 18
  • Best player score: 21
  • Number of attempts: 2
Getters & Setters: Java - 141 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
  • Number of attempts: 1
Reformat long lines - 316 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
  • Number of attempts: 2
imports alignment (python) - 577 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 6
Reverse and count - 379 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
  • Number of attempts: 8
It'ss tooo coold too typpe todaay - 194 entries

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

  • Best score: 16
  • Best player score: 24
  • Number of attempts: 1
Table Reshuffle - 325 entries

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

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 7
not so punk :]
Twitter:

entered into 40 challenges

contributed 0 challenges