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]

31255 active golfers, 378591 entries, 522 challenges

Open VimGolf challenges

Ruby 1.9 compat - 566 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 - 463 entries

Order the paragraphs correctly, per prefixed index

Python Hello World! Reformatting - 879 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 - 548 entries

Fix some very bizarrely laid-out code.

Reformat a C golf submission - 506 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 - 615 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 - 160 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 - 4580 entries

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

Deleting folded text - 281 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 - 326 entries

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

Reformat most common surnames - 547 entries

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

Remember FizzBuzz? - 553 entries

Output FizzBuzz to 100. Start with nothing.

Change the content of a string - 1286 entries

This docstring is a complete lie. Fix it.

Add fold markers to a .c file - 463 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 - 529 entries

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

Reconstruct the Sentence - 1066 entries

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

Sort and add attributes - 1123 entries

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

Braces or Brackets? - 645 entries

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

Flodder-challenge - 829 entries

Replace the text the most efficient and win!

Whitespace, empty lines and tabs - 2788 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

Simple text editing with Vim - 11391 entries

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

Reformat/Refactor a Golfer Class - 5835 entries

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

VimGolf Chatter