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

List the first 100 prime numbers.

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

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

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

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

  • Best score: 12
  • Best player score: 13
  • Position: #764 / 1624
  • Number of attempts: 4
Interweave two blocks of text - 659 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: #106 / 214
  • Number of attempts: 3
Recursively Palindrome - 267 entries

Note that there are 2^6-1 characters.

  • Best score: 21
  • Best player score: 24
  • Position: #45 / 75
  • Number of attempts: 6
Multiplication table. - 232 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 61
  • Position: #25 / 68
  • Number of attempts: 3
Sort the cardinal numbers - 310 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Position: #97 / 148
  • Number of attempts: 1
Line Zipper - 473 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #140 / 215
  • Number of attempts: 2
remove dupes from array - 1358 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: #141 / 336
  • Number of attempts: 4
PHP Array Syntax -> MailChimp Merge Syntax - 545 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: #31 / 150
  • Number of attempts: 4
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: #29 / 180
  • Number of attempts: 3
Complete the hex array data (Part II) - 166 entries

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

  • Best score: 20
  • Best player score: 26
  • Position: #42 / 69
  • Number of attempts: 1
Sort entries based on date - 392 entries

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

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

Align as one import per line.

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

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 20
  • Position: #39 / 100
  • Number of attempts: 3
Rotating Philosophers Problem - 410 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 / 166
  • Number of attempts: 6
HTML to Haml - 878 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 47
  • Position: #159 / 204
  • Number of attempts: 2
Overall Vimgolf Rank - 216 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: 21
  • Best player score: 24
  • Position: #22 / 59
  • Number of attempts: 8
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Position: #206 / 652
  • Number of attempts: 4
The Universal Declaration of Human Rights, Article 1 - 163 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: #38 / 71
  • Number of attempts: 2
Java Array2List - 233 entries

Convert an java array initializer into a list.

  • Best score: 67
  • Best player score: 89
  • Position: #32 / 87
  • Number of attempts: 2
A Simple One - 1050 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 / 664
  • Number of attempts: 1
Reverse characters in a line - 771 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: #38 / 265
  • Number of attempts: 4
Remember FizzBuzz? - 725 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 55
  • Position: #65 / 190
  • Number of attempts: 6
Add fold markers to a .c file - 625 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 / 183
  • Number of attempts: 7
Braces or Brackets? - 1015 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: #200 / 315
  • Number of attempts: 1
Simple text editing with Vim - 12811 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 / 3694
  • Number of attempts: 6
vimja
Twitter:

entered into 27 challenges

contributed 0 challenges