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]

24029 active golfers, 261416 entries, 422 challenges

Open VimGolf challenges

Line 'em up! - 275 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

The meaning - 495 entries

Numbers are fun!

ASCII box - 295 entries

Don't forget to fix typos!

Add Go XML to structure tags - 127 entries

The Go programming language can directly map XML to structure fields. Add the correct XML tag after each field.

Separate the lines - 126 entries

Every other line is mixed up. Separate them into their original texts.

imports alignment (python) - 577 entries

Align as one import per line.

lipsum lines - 239 entries

Convert a quoted block of text into strings in a list.

Reverse characters in a line - 568 entries

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

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

Logging with key - 275 entries

Sometimes it is better to log with meaningful key

Vim tetris - 338 entries

Vim can play tetris too!

7th Birthday - 163 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

vim = 22 / 7 - 398 entries

pi square vim

Remove semicolons after expressions - 441 entries

A follow-up for

Counting in binary - 364 entries

"a" represents 0; "A" represents 1. Start from zero and count to 15.

Remember FizzBuzz? - 523 entries

Output FizzBuzz to 100. Start with nothing.

Reformat most common surnames - 520 entries

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

Interweave two blocks of text - 486 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?

Reformat some Python - 505 entries

Fix some very bizarrely laid-out code.

Split the words - 334 entries

Add the spaces manually if you must, but if you use Vim's spell checking feature wisely, I think you'll save a LARGE number of strokes.

Shuffle puzzle - 289 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

Un"finnish"ed Work - 101 entries

Replace å by a, ä by a and ö by o.

Reverse and double space - 408 entries

Reverse the order of the given lines and double space everything

NATO phonetic alphabet - 385 entries

Transform the series of words into a list.

Subnetting - 64 entries

Split up the IP addresses in the right way.

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

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

Delete unwanted lines - 333 entries

Delete all lines which does not end in "o.."

Increment, increment, increment.... - 479 entries

Vim likes macros

Reformat a C golf submission - 468 entries

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

Pairs of numbers - 325 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

For all cases. - 102 entries

In this case... change it! :) Watch the line.

Replacing some words - 405 entries

How fast could it be?

Stairs Indenting - 359 entries

Indent each line with <line number> whitespaces.

A simple change - 354 entries

Just change the numbers in the most efficient way ...

PHP Array Syntax -> MailChimp Merge Syntax - 414 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

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

Sorting paragraphs - 443 entries

Order the paragraphs correctly, per prefixed index

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.

Sort files from hosts - 126 entries

Resume files by host. I hope you enjoy with this challenge

Going underground.... - 283 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

Shuffled numbers - 199 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

Indentation - 413 entries

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

Line Zipper - 393 entries

Zip/pair related lines.

vim1001 - 227 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

Mirrored text - 153 entries

backward and forward, and long enough to be challenging

The Quick Brown Fox Jumps Over The Lazy Vim - 325 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."

Generate English Alphabets - 400 entries

Start with a, get up to z.

you're stuck on jQuery < 1.7 - 317 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

FoodCritic023: Prefer conditional attributes - 161 entries

FoodCritic ( is a lint tool for your Chef ( cookbooks. FC023 indicates that you should prefer Chef guards over Ruby conditions. This challenge expects you to be able to fix this issue in a sample cookbook, given the FoodCritic output: ================================================================ FC023: Prefer conditional attributes: cookbooks/foo/recipes/default.rb:25 ================================================================ See for more details about the changes being made.

Case preserving word replacement - 384 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

VimGolf Chatter