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

Remember FizzBuzz? - 537 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 49
  • Number of attempts: 8
Prime Numbers - 267 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 43
  • Number of attempts: 1
Reformat some Python - 511 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 40
  • Number of attempts: 3
Cartesian product - 201 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 38
  • Number of attempts: 2
The Quick Brown Fox Jumps Over The Lazy Vim - 330 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 1
Search and Replace 0 - 4166 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 4
Reverse Simple Deletion - 714 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
switch variable - 4342 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 2
Remove semicolons after expressions - 460 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 2
Change the content of a string - 1238 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Number of attempts: 3
Python to Ruby - 188 entries

Convert this Python code to Ruby. NOTE: This program likely won't run.

  • Best score: 24
  • Best player score: 27
  • Number of attempts: 2
Python Hello World! Reformatting - 837 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: 41
  • Number of attempts: 4
Line Zipper - 397 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 3
The meaning - 502 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Compile C - 279 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 1
Braces or Brackets? - 626 entries

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

  • Best score: 34
  • Best player score: 34
  • Number of attempts: 11
Wrap the text of an email message to 79 characters - 492 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
Simple text editing with Vim - 10535 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: 10
Reverse characters in a line - 585 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: 5
The Cake is a Lie - 1127 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Append semicolon after expressions - 869 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 4
Generate Fibonacci Numbers - 200 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 4
Increment, increment, increment.... - 491 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
The name of the game - 582 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
SFD-ROC: ROT13 Phonics - 70 entries

A is for apple, b is for ball, etc... This familiar phonics poem has been rotated 13 characters. Make the letter match the word.

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 1
Reconstruct the Sentence - 1028 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: 20
  • Number of attempts: 8
Almost encrypted - 165 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
A Simple One - 845 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
Ruby 1.9 compat - 557 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: 14
  • Number of attempts: 4
Exchanging Quotes - 761 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 31
  • Number of attempts: 9
Reformat most common surnames - 520 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 25
  • Number of attempts: 1
Context insensitive completion 0 - 445 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 7
  • Number of attempts: 3
Context Insensitive completion 1 - 395 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 2
Make it more readable - 1761 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 6
SFD-ROC: vimvimvim - 1294 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 9
  • Number of attempts: 4
Sorting paragraphs - 443 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 24
  • Number of attempts: 9
Flodder-challenge - 807 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 28
  • Number of attempts: 13
SFD-ROC: The Quick Brown Fox - 140 entries

Someone has vandalized our text (again). Please fix to read: The Quick Brown Fox Jumps Over The Lazy Dog.

  • Best score: 25
  • Best player score: 28
  • Number of attempts: 1
SFD-ROC: Pipe Dreams - 93 entries

Move the pipes so they match the output.

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 2
remove dupes from array - 1197 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: 17
  • Number of attempts: 7
Numbering a List - 1743 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Number of attempts: 4
replacing each line of a block selection - 2542 entries

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

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 10
Get rid of html tags - 315 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 15
  • Best player score: 23
  • Number of attempts: 2
Interweave two blocks of text - 498 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: 16
  • Number of attempts: 4
Table Reshuffle - 325 entries

Fix the column order in this table... also append the new 'username' column.

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 4
Switch function arguments - 1841 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 4
Vertical Limit - 2126 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 29
  • Number of attempts: 1
Reverse and double space - 408 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 3
Add fold markers to a .c file - 441 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: 8
Reformat/Refactor a Golfer Class - 5524 entries

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

  • Best score: 32
  • Best player score: 32
  • Number of attempts: 8
Sort and add attributes - 1090 entries

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

  • Best score: 33
  • Best player score: 33
  • Number of attempts: 3
Vim rocks
Twitter:

entered into 51 challenges

contributed 0 challenges