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]

21782 active golfers, 223575 entries, 385 challenges

Open VimGolf challenges

Ugly spreadsheet copy/paste to CSV - 643 entries

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

Pretty multi-line bash - 188 entries

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

Angular naming conventions - 258 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!

Happy TvvO - 337 entries

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

The name of the game - 556 entries

End up with the name of the game.

Remove noise from HTTP log - 576 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".

HTML to Haml - 649 entries

Help convert this HTML page to Haml.

lipsum lines - 232 entries

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

Assignment Alignment - 649 entries

line up the operators. Use spaces, not tabs.

Swap assigned value - 481 entries

Simple problem but looking for interesting solutions.

readability - 278 entries

Make the code readable by adding some spaces

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?

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 - 456 entries

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

Braces or Brackets? - 617 entries

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

For all cases. - 88 entries

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

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.

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.

Logging with key - 263 entries

Sometimes it is better to log with meaningful key

The meaning - 480 entries

Numbers are fun!

imports alignment (python) - 566 entries

Align as one import per line.

Sort files from hosts - 119 entries

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

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 http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

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

Reformat some Python - 496 entries

Fix some very bizarrely laid-out code.

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.

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

Start coding format - 112 entries

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

NATO phonetic alphabet - 372 entries

Transform the series of words into a list.

Mirrored text - 148 entries

backward and forward, and long enough to be challenging

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 - 310 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.

A simple change - 343 entries

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

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