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]

21586 active golfers, 220883 entries, 385 challenges

Open VimGolf challenges

Pretty multi-line bash - 188 entries

Bash line continuations are much prettier when they're column aligned.

Ugly spreadsheet copy/paste to CSV - 640 entries

convert an ugly spreadsheet copy/paste into a CSV format.

Angular naming conventions - 254 entries

In angular, a directive name follows the camelCase convention. When the directive is used in an HTML template, the words are instead separated by a dash. Go from to the other the fastest!

The name of the game - 553 entries

End up with the name of the game.

Happy TvvO - 327 entries

Don’t forget the past, learn from it. Happy New Year.

Remove noise from HTTP log - 567 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

Lisp Condense - 354 entries

Reduce 4 cons selection operations down to one function call.

Reverse Simple Deletion - 679 entries

You did the simple deletion, now reverse it.

VimGolfNight - 433 entries

Based on "The name of the game".

lipsum lines - 232 entries

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

For all cases. - 88 entries

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

HTML to Haml - 649 entries

Help convert this HTML page to Haml.

readability - 276 entries

Make the code readable by adding some spaces

Swap assigned value - 481 entries

Simple problem but looking for interesting solutions.

Add to end of each line... kinda - 247 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

Assignment Alignment - 649 entries

line up the operators. Use spaces, not tabs.

Line 'em up! - 263 entries

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

120 Degrees - 333 entries

Rotate that triangle.

ASCII box - 286 entries

Don't forget to fix typos!

Prefixes and suffixes - 454 entries

Generate all prefixes of "vimchallenge", then all suffixes.

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

Braces or Brackets? - 617 entries

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

Minimalist Limerick - 438 entries

Reproduce this lovely poem.

lamb had a little Mary - 447 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

Logging with key - 263 entries

Sometimes it is better to log with meaningful key

The meaning - 480 entries

Numbers are fun!

Sort files from hosts - 119 entries

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

imports alignment (python) - 566 entries

Align as one import per line.

Reverse characters in a line - 547 entries

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

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

vim = 22 / 7 - 390 entries

pi square vim

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

Remove semicolons after expressions - 423 entries

A follow-up for

Vim tetris - 300 entries

Vim can play tetris too!

Remember FizzBuzz? - 511 entries

Output FizzBuzz to 100. Start with nothing.

Reformat most common surnames - 510 entries

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

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

Reformat some Python - 496 entries

Fix some very bizarrely laid-out code.

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

Counting in binary - 322 entries

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

Reverse and double space - 400 entries

Reverse the order of the given lines and double space everything

NATO phonetic alphabet - 372 entries

Transform the series of words into a list.

Pairs of numbers - 316 entries

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

Delete unwanted lines - 309 entries

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

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

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

Stairs Indenting - 348 entries

Indent each line with <line number> whitespaces.

Shuffled numbers - 195 entries

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

A simple change - 343 entries

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

Replacing some words - 396 entries

How fast could it be?

Reformat a C golf submission - 458 entries

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

VimGolf Chatter