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]

22739 active golfers, 238326 entries, 395 challenges

Open VimGolf challenges

A Simple One - 806 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

Flodder-challenge - 787 entries

Replace the text the most efficient and win!

Ugly spreadsheet copy/paste to CSV - 663 entries

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

Generate a list of numbers - 216 entries

Please generate list of numbers from 1 to 20.

The name of the game - 571 entries

End up with the name of the game.

Text to HTML Table - 127 entries

Turn the plain text table to an HTML table.

Remove noise from HTTP log - 581 entries

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

replace 2nd column blanks with values in same column if blank - 172 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

Add Go XML to structure tags - 122 entries

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

Reverse Simple Deletion - 692 entries

You did the simple deletion, now reverse it.

Happy TvvO - 339 entries

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

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

VimGolfNight - 447 entries

Based on "The name of the game".

HTML to Haml - 665 entries

Help convert this HTML page to Haml.

Separate the lines - 116 entries

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

Lisp Condense - 356 entries

Reduce 4 cons selection operations down to one function call.

Pretty multi-line bash - 189 entries

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

Assignment Alignment - 650 entries

line up the operators. Use spaces, not tabs.

Swap assigned value - 482 entries

Simple problem but looking for interesting solutions.

Subnetting - 56 entries

Split up the IP addresses in the right way.

Prefixes and suffixes - 464 entries

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

Add to end of each line... kinda - 257 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?

120 Degrees - 337 entries

Rotate that triangle.

Braces or Brackets? - 617 entries

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

readability - 278 entries

Make the code readable by adding some spaces

Line 'em up! - 268 entries

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

lipsum lines - 232 entries

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

ASCII box - 286 entries

Don't forget to fix typos!

Minimalist Limerick - 441 entries

Reproduce this lovely poem.

Un"finnish"ed Work - 98 entries

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

lamb had a little Mary - 449 entries

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

The meaning - 487 entries

Numbers are fun!

imports alignment (python) - 570 entries

Align as one import per line.

Logging with key - 263 entries

Sometimes it is better to log with meaningful key

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

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

pi square vim

Remove semicolons after expressions - 425 entries

A follow-up for

Remember FizzBuzz? - 512 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

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.

For all cases. - 91 entries

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

Vim tetris - 301 entries

Vim can play tetris too!

Reformat some Python - 496 entries

Fix some very bizarrely laid-out code.

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

NATO phonetic alphabet - 381 entries

Transform the series of words into a list.

Sort files from hosts - 121 entries

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

Reverse and double space - 401 entries

Reverse the order of the given lines and double space everything

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.

VimGolf Chatter