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 - 261 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 376
  • Number of attempts: 1
Java Array2List - 210 entries

Convert an java array initializer into a list.

  • Best score: 67
  • Best player score: 89
  • Number of attempts: 2
Multiplication table. - 170 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 61
  • Number of attempts: 3
Remember FizzBuzz? - 512 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 55
  • Number of attempts: 6
Braces or Brackets? - 617 entries

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

  • Best score: 34
  • Best player score: 48
  • Number of attempts: 1
Simple text editing with Vim - 9868 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 6
Sort entries based on date - 292 entries

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

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Reverse characters in a line - 547 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
  • Number of attempts: 4
Line Zipper - 388 entries

Zip/pair related lines.

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

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 1
imports alignment (python) - 570 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 6
Numbering a List - 1684 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Number of attempts: 4
Wrap the text of an email message to 79 characters - 472 entries

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

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
A Simple One - 806 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: 1
Case preserving word replacement - 383 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: 3
Add fold markers to a .c file - 439 entries

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

  • Best score: 30
  • Best player score: 30
  • Number of attempts: 7
remove dupes from array - 1158 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
  • Number of attempts: 4
PHP Array Syntax -> MailChimp Merge Syntax - 407 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
  • Number of attempts: 4
Overall Vimgolf Rank - 138 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: 8
  • Best player score: 24
  • Number of attempts: 8
Recursively Palindrome - 204 entries

Note that there are 2^6-1 characters.

  • Best score: 6
  • Best player score: 24
  • Number of attempts: 6
Interweave two blocks of text - 472 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: 3
Search and Replace 0 - 3819 entries

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

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 4
The Universal Declaration of Human Rights, Article 1 - 128 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
  • Number of attempts: 2
Rotating Philosophers Problem - 346 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
  • Number of attempts: 6
Generate Fibonacci Numbers - 199 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 20
  • Number of attempts: 3
Complete the hex array data (Part II) - 123 entries

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

  • Best score: 20
  • Best player score: 26
  • Number of attempts: 1
HTML to Haml - 665 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 47
  • Number of attempts: 2
vimja
Twitter:

entered into 27 challenges

contributed 0 challenges