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

82 bottles of beer on the wall - 261 entries

Take them down. (sorry, only 82 bottles because the problem size is limited!)

  • Best score: 107
  • Best player score: 113
  • Number of attempts: 5
constructor - 162 entries

coding a constructor for a simple class

  • Best score: 59
  • Best player score: 107
  • Number of attempts: 1
Make Fancy Header - 923 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 18
  • Number of attempts: 3
Sort the cardinal numbers - 221 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 1
Alphabetize the directory - 260 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 37
  • Number of attempts: 1
replacing each line of a block selection - 2604 entries

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

  • Best score: 18
  • Best player score: 24
  • Number of attempts: 2
switch variable - 4451 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • 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: 2
formatted text to markdown - 175 entries

You're converting some posts from an old blog to markdown. The formatted text is far closer to the finished product than the html markup, so it seems like a good place to start. Word wrapping seems to be the main area for optimization.

  • Best score: 70
  • Best player score: 96
  • Number of attempts: 1
The Cake is a Lie - 1140 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 3
Let's play some Ivmgolf - 945 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 4
A Simple One - 849 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
Wrap the text of an email message to 79 characters - 495 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
Reconstruct the Sentence - 1030 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: 22
  • Number of attempts: 2
Case preserving word replacement - 392 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: 23
  • Number of attempts: 2
quotes inside quotes - 2844 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 17
  • Number of attempts: 1
Rotating Philosophers Problem - 358 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: 30
  • Number of attempts: 1
Numbering a List - 1754 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Number of attempts: 1
Fix the Haiku - 247 entries

Change this slightly scrambled haiku to its unscrambled form and fix the capitalisation and punctuation along the way.

  • Best score: 28
  • Best player score: 31
  • Number of attempts: 4
Interweave two blocks of text - 502 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: 22
  • Number of attempts: 1
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: 36
  • Number of attempts: 1
remove dupes from array - 1253 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: 35
  • Number of attempts: 1
PHP Array Syntax -> MailChimp Merge Syntax - 427 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: 38
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 5570 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 39
  • Number of attempts: 5
Mislav Marohnić
Twitter:

I'm your favorite kind of geek.

entered into 24 challenges

contributed 0 challenges