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]

39587 active golfers, 470522 entries, 603 challenges

Open VimGolf challenges

Cartesian product - 255 entries

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

Return the cow - 75 entries

This cow is too verbose. Give it a lesson.

Solve the Sokoban - 177 entries

A wink for all Vimgolfers that play Nethack too.

CSV to JSON - 173 entries

A search for shortest vimissh way to convert CSV to JSON.

Generate Fibonacci Numbers - 280 entries

Use your super vim powers to generate Fibonacci Numbers.

The holy-grail may help - 362 entries

Can you find it in less than 20 strokes, Arthur?

Shebangs for all - 1998 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.

Ruby 1.9 hashes - 1244 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!

Reverse and count - 473 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

Letters are numbers - 167 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?

Almost encrypted - 204 entries

Convert the first paragraph to be even less readable.

Reverse Simple Deletion - 847 entries

You did the simple deletion, now reverse it.

Dumb to smart - 97 entries

Turn dumb quote to smart vim's way.

82 bottles of beer on the wall - 312 entries

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

Make Fancy Header - 1046 entries

Make the header text stand out with surrounding asterisks

The Cake is a Lie - 1339 entries

Correct the capitalization of each word

Increment, increment, increment.... - 684 entries

Vim likes macros

Remove Accent off the Letter - 126 entries

Remove all the accent from extremely accented statements.

Compile C - 420 entries

You might have to get clever to do this one.

Another Mixed-Up Haiku - 257 entries

VimGolf ... a perfect evening?

Prime Numbers - 354 entries

List the first 100 prime numbers.

A Simple One - 1047 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

Round Round - 299 entries

Round Round

Table Reshuffle - 410 entries

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

Fix the Haiku - 293 entries

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

Indentation - 534 entries

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

Linear congruential generator - 137 entries

http://en.wikipedia.org/wiki/Linear_congruential_generator

Hatsuyume - 513 entries

http://en.wikipedia.org/wiki/Hatsuyume

Context Insensitive completion 1 - 494 entries

Finish writing this simple Python HTTP server.

Turn this csv list into queries - 238 entries

Transform each line of this csv file into a MySQL-ready INSERT query.

Context insensitive completion 0 - 566 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.

Ruby 1.9 compat - 627 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!

Sorting paragraphs - 514 entries

Order the paragraphs correctly, per prefixed index

Python Hello World! Reformatting - 989 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.

Reformat some Python - 604 entries

Fix some very bizarrely laid-out code.

Reformat a C golf submission - 589 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

Reverse characters in a line - 757 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

PEP8 Python Wrapping Comments and Code - 207 entries

According to PEP8, long flowy text and code should have different max line lengths. Code: 79 characters max Long flowy text: 72 characters max

Search and Replace 0 - 4978 entries

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

Deleting folded text - 350 entries

The text below contains three folds. Delete them (and the text inside them). For example: 123 456 /*{{{*/ 789 /*}}}*/ 012 Should become: 123 012 Also, add `aoeuaoeu` to make sure small solutions don't get flagged as cheating.

Get rid of html tags - 394 entries

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

Reformat most common surnames - 698 entries

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

Remember FizzBuzz? - 713 entries

Output FizzBuzz to 100. Start with nothing.

Change the content of a string - 1567 entries

This docstring is a complete lie. Fix it.

Add fold markers to a .c file - 608 entries

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

Wrap the text of an email message to 79 characters - 754 entries

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

Reconstruct the Sentence - 1487 entries

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

Sort and add attributes - 1436 entries

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

Braces or Brackets? - 972 entries

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

Flodder-challenge - 1245 entries

Replace the text the most efficient and win!

VimGolf Chatter