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]

23493 active golfers, 251886 entries, 409 challenges

Open VimGolf challenges

Reformat most common surnames - 515 entries

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

7th Birthday - 149 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.

Remember FizzBuzz? - 513 entries

Output FizzBuzz to 100. Start with nothing.

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

Shuffle puzzle - 285 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.

Reformat some Python - 498 entries

Fix some very bizarrely laid-out code.

Vim tetris - 302 entries

Vim can play tetris too!

Subnetting - 57 entries

Split up the IP addresses in the right way.

Counting in binary - 335 entries

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

Split the words - 319 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.

For all cases. - 99 entries

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

NATO phonetic alphabet - 382 entries

Transform the series of words into a list.

Reverse and double space - 402 entries

Reverse the order of the given lines and double space everything

Delete unwanted lines - 330 entries

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

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

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

Increment, increment, increment.... - 475 entries

Vim likes macros

Reformat a C golf submission - 464 entries

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

Stairs Indenting - 357 entries

Indent each line with <line number> whitespaces.

A simple change - 352 entries

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

Replacing some words - 402 entries

How fast could it be?

Pairs of numbers - 316 entries

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

PHP Array Syntax -> MailChimp Merge Syntax - 408 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!

Sort files from hosts - 123 entries

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

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

Add fold markers to a .c file - 439 entries

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

Sorting paragraphs - 437 entries

Order the paragraphs correctly, per prefixed index

Going underground.... - 277 entries

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

Mirrored text - 151 entries

backward and forward, and long enough to be challenging

Shuffled numbers - 195 entries

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

Line Zipper - 389 entries

Zip/pair related lines.

vim1001 - 221 entries

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

Indentation - 406 entries

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

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

you're stuck on jQuery < 1.7 - 314 entries

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

Start coding format - 114 entries

I used to start coding with following format: int main(){ -(cursor here) }

Case preserving word replacement - 383 entries

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

Generate English Alphabets - 389 entries

Start with a, get up to z.

Context Insensitive completion 1 - 388 entries

Finish writing this simple Python HTTP server.

NBCU Weekly Challenge - Test - 214 entries

Just testing.

FoodCritic023: Prefer conditional attributes - 150 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.

Reverse and count - 378 entries

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

Insert a Markdown link - 377 entries

Put a link in a markdown document, using the after-the-paragraph format.

underscore_to_camelCase - 134 entries

Pointy haired boss decided we need to switch to camelCase. Let's get this over with.

Sorting database text output - 183 entries

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

JS notation to Immutable.js notation - 137 entries

Now Immutable.js made its way into many frontends. This challenge consists of a typical refactoring that many of us are facing now.

Hatsuyume - 360 entries

Vim's not included features - 150 entries

Filter not included (-) features in a hypothetical installation of vim.

A grid of punctuation - 110 entries

Create a checkerboard of = and - in an 80×24 grid!

Rotating Philosophers Problem - 346 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

Array of characters - 107 entries

We all copy paste things off the internet, but the syntax doesn't look right. Fix it as fast as possible.

VimGolf Chatter