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]

22919 active golfers, 242017 entries, 397 challenges

Open VimGolf challenges

Mute the second method of this script - 403 entries

prepend a # infront of every line of the second method

A Simple One - 820 entries

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

Python Hello World! Reformatting - 818 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

Flodder-challenge - 794 entries

Replace the text the most efficient and win!

Ugly spreadsheet copy/paste to CSV - 678 entries

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

Generate a list of numbers - 219 entries

Please generate list of numbers from 1 to 20.

The name of the game - 573 entries

End up with the name of the game.

Remove noise from HTTP log - 588 entries

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

Text to HTML Table - 129 entries

Turn the plain text table to an HTML table.

Reverse Simple Deletion - 694 entries

You did the simple deletion, now reverse it.

replace 2nd column blanks with values in same column if blank - 173 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.

Happy TvvO - 341 entries

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

Add Go XML to structure tags - 123 entries

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

VimGolfNight - 449 entries

Based on "The name of the game".

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

HTML to Haml - 667 entries

Help convert this HTML page to Haml.

Separate the lines - 120 entries

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

Lisp Condense - 357 entries

Reduce 4 cons selection operations down to one function call.

Assignment Alignment - 651 entries

line up the operators. Use spaces, not tabs.

Pretty multi-line bash - 190 entries

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

Swap assigned value - 483 entries

Simple problem but looking for interesting solutions.

Prefixes and suffixes - 465 entries

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

Add to end of each line... kinda - 258 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 - 338 entries

Rotate that triangle.

Braces or Brackets? - 618 entries

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

readability - 279 entries

Make the code readable by adding some spaces

Line 'em up! - 269 entries

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

Subnetting - 57 entries

Split up the IP addresses in the right way.

lipsum lines - 233 entries

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

Minimalist Limerick - 441 entries

Reproduce this lovely poem.

ASCII box - 286 entries

Don't forget to fix typos!

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!

Un"finnish"ed Work - 98 entries

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

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

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.

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.

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

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

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.

Vim tetris - 301 entries

Vim can play tetris too!

Interweave two blocks of text - 473 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 - 496 entries

Fix some very bizarrely laid-out code.

For all cases. - 91 entries

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

NATO phonetic alphabet - 381 entries

Transform the series of words into a list.

Reverse and double space - 401 entries

Reverse the order of the given lines and double space everything

VimGolf Chatter