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

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 89
  • Position: #70 / 95
  • Number of attempts: 3
Word Blender - 129 entries

The insides of long words seem to have been run through the blender. Can you fix this famous tale, brave knight?

  • Best score: 28
  • Best player score: 68
  • Position: #37 / 54
  • Number of attempts: 2
Python Hello World! Reformatting - 894 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 44
  • Position: #191 / 348
  • Number of attempts: 2
Reformat long lines - 323 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: 18
  • Position: #63 / 127
  • Number of attempts: 1
Ruby 1.9 hashes - 1137 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: 13
  • Position: #111 / 379
  • Number of attempts: 3
Shebangs for all - 1763 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: 13
  • Position: #152 / 466
  • Number of attempts: 4
A Simple One - 912 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: #106 / 606
  • Number of attempts: 1
Reverse and count - 407 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: 24
  • Position: #42 / 155
  • Number of attempts: 3
Letters are numbers - 128 entries

Letters and numbers are interchangeable. A lot of programming languages give you simple ways to convert individual letters to hex, binary and decimal but does Vim?

  • Best score: 20
  • Best player score: 32
  • Position: #46 / 67
  • Number of attempts: 1
Ruby 1.9 compat - 587 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: 15
  • Position: #78 / 224
  • Number of attempts: 3
Reverse Simple Deletion - 754 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #127 / 427
  • Number of attempts: 1
Increment, increment, increment.... - 557 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #125 / 367
  • Number of attempts: 1
Indentation - 443 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 21
  • Best player score: 24
  • Position: #32 / 158
  • Number of attempts: 3
Context Insensitive completion 1 - 422 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #34 / 218
  • Number of attempts: 2
Reverse characters in a line - 634 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: 14
  • Position: #78 / 234
  • Number of attempts: 1
Sort and add attributes - 1171 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #22 / 479
  • Number of attempts: 3
Add fold markers to a .c file - 479 entries

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

  • Best score: 30
  • Best player score: 49
  • Position: #135 / 155
  • Number of attempts: 1
Israel Chauca F.
Twitter:

entered into 17 challenges

contributed 0 challenges