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

Prime Numbers - 344 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 376
  • Position: #98 / 102
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 679 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #78 / 386
  • Number of attempts: 1
Search and Replace 0 - 4792 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #739 / 1585
  • Number of attempts: 4
Interweave two blocks of text - 631 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: #103 / 211
  • Number of attempts: 3
Recursively Palindrome - 239 entries

Note that there are 2^6-1 characters.

  • Best score: 21
  • Best player score: 24
  • Position: #43 / 73
  • Number of attempts: 6
Multiplication table. - 205 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 61
  • Position: #23 / 63
  • Number of attempts: 3
Sort the cardinal numbers - 293 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Position: #95 / 146
  • Number of attempts: 1
Line Zipper - 450 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #136 / 210
  • Number of attempts: 2
remove dupes from array - 1336 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: 21
  • Position: #137 / 331
  • Number of attempts: 4
PHP Array Syntax -> MailChimp Merge Syntax - 507 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: 24
  • Position: #29 / 148
  • Number of attempts: 4
Case preserving word replacement - 453 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: #29 / 179
  • Number of attempts: 3
Complete the hex array data (Part II) - 156 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

  • Best score: 20
  • Best player score: 26
  • Position: #41 / 67
  • Number of attempts: 1
Sort entries based on date - 363 entries

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

  • Best score: 11
  • Best player score: 11
  • Position: #5 / 114
  • Number of attempts: 3
imports alignment (python) - 661 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Position: #24 / 194
  • Number of attempts: 6
Generate Fibonacci Numbers - 262 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 20
  • Position: #37 / 97
  • Number of attempts: 3
Rotating Philosophers Problem - 390 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: 29
  • Position: #15 / 163
  • Number of attempts: 6
HTML to Haml - 842 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 47
  • Position: #157 / 202
  • Number of attempts: 2
Overall Vimgolf Rank - 170 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: 24
  • Position: #20 / 57
  • Number of attempts: 8
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Position: #198 / 639
  • Number of attempts: 4
The Universal Declaration of Human Rights, Article 1 - 148 entries

Somebody's got this slightly muddled up. See how quickly you can fix it. (I made this to experiment with buffers. I'm not actually sure whether this is faster with buffers or without.)

  • Best score: 24
  • Best player score: 26
  • Position: #36 / 69
  • Number of attempts: 2
Java Array2List - 225 entries

Convert an java array initializer into a list.

  • Best score: 67
  • Best player score: 89
  • Position: #31 / 83
  • Number of attempts: 2
A Simple One - 1001 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: #231 / 643
  • Number of attempts: 1
Reverse characters in a line - 709 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 13
  • Position: #34 / 249
  • Number of attempts: 4
Remember FizzBuzz? - 654 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 55
  • Position: #58 / 177
  • Number of attempts: 6
Add fold markers to a .c file - 556 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

  • Best score: 30
  • Best player score: 30
  • Position: #12 / 172
  • Number of attempts: 7
Braces or Brackets? - 884 entries

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

  • Best score: 34
  • Best player score: 48
  • Position: #187 / 288
  • Number of attempts: 1
Simple text editing with Vim - 12290 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #33 / 3581
  • Number of attempts: 6
vimja
Twitter:

entered into 27 challenges

contributed 0 challenges