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

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 43
  • Position: #49 / 107
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 846 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #132 / 437
  • Number of attempts: 1
Search and Replace 0 - 5027 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #172 / 1637
  • Number of attempts: 4
Interweave two blocks of text - 661 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
  • Position: #44 / 215
  • Number of attempts: 4
Python Hello World! Reformatting - 1007 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
  • Position: #54 / 384
  • Number of attempts: 4
Cartesian product - 266 entries

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

  • Best score: 24
  • Best player score: 38
  • Position: #78 / 99
  • Number of attempts: 2
SFD-ROC: The Quick Brown Fox - 202 entries

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

  • Best score: 24
  • Best player score: 28
  • Position: #42 / 108
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 425 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: 8
  • Best player score: 10
  • Position: #33 / 193
  • Number of attempts: 1
The name of the game - 678 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #34 / 363
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1620 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #153 / 450
  • Number of attempts: 4
SFD-ROC: Pipe Dreams - 115 entries

Move the pipes so they match the output.

  • Best score: 12
  • Best player score: 15
  • Position: #23 / 47
  • Number of attempts: 2
Python to Ruby - 204 entries

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

  • Best score: 24
  • Best player score: 27
  • Position: #14 / 61
  • Number of attempts: 2
SFD-ROC: ROT13 Phonics - 101 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
  • Position: #25 / 73
  • Number of attempts: 1
Vertical Limit - 2596 entries

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

  • Best score: 21
  • Best player score: 29
  • Position: #622 / 767
  • Number of attempts: 1
Exchanging Quotes - 859 entries

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

  • Best score: 30
  • Best player score: 31
  • Position: #29 / 231
  • Number of attempts: 9
replacing each line of a block selection - 3007 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #41 / 780
  • Number of attempts: 10
Switch function arguments - 2182 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #41 / 674
  • Number of attempts: 4
Append semicolon after expressions - 1061 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #28 / 421
  • Number of attempts: 4
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Position: #38 / 199
  • Number of attempts: 3
Remove semicolons after expressions - 663 entries

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

  • Best score: 6
  • Best player score: 6
  • Position: #45 / 264
  • Number of attempts: 2
switch variable - 5094 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #132 / 1754
  • Number of attempts: 2
The meaning - 577 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #148 / 364
  • Number of attempts: 1
Make it more readable - 2009 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #27 / 652
  • Number of attempts: 6
Line Zipper - 477 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 13
  • Position: #53 / 216
  • Number of attempts: 3
remove dupes from array - 1360 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
  • Position: #42 / 337
  • Number of attempts: 7
Generate Fibonacci Numbers - 294 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 19
  • Position: #9 / 104
  • Number of attempts: 4
Numbering a List - 1940 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Position: #119 / 656
  • Number of attempts: 4
A Simple One - 1067 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: #286 / 671
  • Number of attempts: 1
Table Reshuffle - 450 entries

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

  • Best score: 22
  • Best player score: 23
  • Position: #21 / 144
  • Number of attempts: 4
Ruby 1.9 compat - 640 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
  • Position: #35 / 236
  • Number of attempts: 4
Reverse Simple Deletion - 862 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #247 / 463
  • Number of attempts: 1
Increment, increment, increment.... - 701 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #243 / 413
  • Number of attempts: 1
Sorting paragraphs - 552 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 24
  • Position: #45 / 165
  • Number of attempts: 9
The Cake is a Lie - 1386 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #129 / 537
  • Number of attempts: 2
Context insensitive completion 0 - 592 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
  • Position: #75 / 250
  • Number of attempts: 3
Compile C - 441 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 19
  • Position: #3 / 143
  • Number of attempts: 1
Context Insensitive completion 1 - 512 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #91 / 248
  • Number of attempts: 2
Almost encrypted - 204 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Position: #91 / 146
  • Number of attempts: 1
Reformat some Python - 627 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 40
  • Position: #93 / 240
  • Number of attempts: 3
Reverse characters in a line - 789 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: #53 / 269
  • Number of attempts: 5
Reformat most common surnames - 782 entries

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

  • Best score: 23
  • Best player score: 25
  • Position: #58 / 227
  • Number of attempts: 1
Remember FizzBuzz? - 758 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 49
  • Position: #38 / 200
  • Number of attempts: 8
Get rid of html tags - 423 entries

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

  • Best score: 12
  • Best player score: 23
  • Position: #203 / 245
  • Number of attempts: 2
Change the content of a string - 1707 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #84 / 628
  • Number of attempts: 3
Sort and add attributes - 1539 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #120 / 594
  • Number of attempts: 3
Add fold markers to a .c file - 683 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: #25 / 194
  • Number of attempts: 8
Reconstruct the Sentence - 1677 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 19
  • Best player score: 20
  • Position: #64 / 440
  • Number of attempts: 8
Braces or Brackets? - 1096 entries

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

  • Best score: 34
  • Best player score: 34
  • Position: #9 / 339
  • Number of attempts: 11
Flodder-challenge - 1401 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 28
  • Position: #62 / 358
  • Number of attempts: 13
Simple text editing with Vim - 13262 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #105 / 3810
  • Number of attempts: 10
Reformat/Refactor a Golfer Class - 7389 entries

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

  • Best score: 7
  • Best player score: 32
  • Position: #40 / 1825
  • Number of attempts: 8
Vim rocks
Twitter:

entered into 51 challenges

contributed 0 challenges