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]

22293 active golfers, 231048 entries, 392 challenges

Open VimGolf challenges

Subnetting - 54 entries

Split up the IP addresses in the right way.

Ugly spreadsheet copy/paste to CSV - 662 entries

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

Generate a list of numbers - 213 entries

Please generate list of numbers from 1 to 20.

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.

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

Separate the lines - 116 entries

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

The name of the game - 569 entries

End up with the name of the game.

Remove noise from HTTP log - 579 entries

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

Happy TvvO - 339 entries

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

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

Pretty multi-line bash - 189 entries

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

Reverse Simple Deletion - 681 entries

You did the simple deletion, now reverse it.

VimGolfNight - 442 entries

Based on "The name of the game".

HTML to Haml - 665 entries

Help convert this HTML page to Haml.

Lisp Condense - 356 entries

Reduce 4 cons selection operations down to one function call.

Un"finnish"ed Work - 97 entries

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

Assignment Alignment - 649 entries

line up the operators. Use spaces, not tabs.

Swap assigned value - 482 entries

Simple problem but looking for interesting solutions.

Add to end of each line... kinda - 254 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! - 268 entries

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

readability - 278 entries

Make the code readable by adding some spaces

lipsum lines - 232 entries

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

Prefixes and suffixes - 461 entries

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

120 Degrees - 333 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!

ASCII box - 286 entries

Don't forget to fix typos!

Minimalist Limerick - 441 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 - 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.

The meaning - 481 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

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.

For all cases. - 89 entries

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

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

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

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.

Remember FizzBuzz? - 512 entries

Output FizzBuzz to 100. Start with nothing.

Vim tetris - 301 entries

Vim can play tetris too!

Reformat most common surnames - 510 entries

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

Sort files from hosts - 119 entries

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

Reformat some Python - 496 entries

Fix some very bizarrely laid-out code.

Interweave two blocks of text - 468 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.

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.

Reverse and double space - 400 entries

Reverse the order of the given lines and double space everything

Counting in binary - 322 entries

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

Delete unwanted lines - 315 entries

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

Pairs of numbers - 316 entries

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

VimGolf Chatter