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]

28207 active golfers, 331930 entries, 479 challenges

Open VimGolf challenges

HTML to Haml - 746 entries

Help convert this HTML page to Haml.

Mute the second method of this script - 418 entries

prepend a # infront of every line of the second method

unknown command - 118 entries

I want change 5 words

Wrap text in quotes - 306 entries

All the blocks of text should be wrapped in quotation marks.

Remove noise from HTTP log - 622 entries

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

Reverse Simple Deletion - 732 entries

You did the simple deletion, now reverse it.

The name of the game - 594 entries

End up with the name of the game.

Comparing Schema With Diff - 50 entries

Sometimes databases output things differently one to another. Fixing things that are out of order will make the diffs more usable.

Nesting SASS - 235 entries

Move a block inside another block and indent it

Assignment Alignment - 716 entries

line up the operators. Use spaces, not tabs.

Stairstep digits - 225 entries

Remove the evens. Double the odds.

Combines all items - 250 entries

For each line that starts with the same number I want to combine its contents

Prefixes and suffixes - 523 entries

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

lamb had a little Mary - 522 entries

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

VimGolfNight - 469 entries

Based on "The name of the game".

Braces or Brackets? - 643 entries

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

Lisp Condense - 396 entries

Reduce 4 cons selection operations down to one function call.

Swap assigned value - 505 entries

Simple problem but looking for interesting solutions.

Happy TvvO - 364 entries

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

Minimalist Limerick - 493 entries

Reproduce this lovely poem.

Flip the bit - 86 entries

Change the specific 0 to a 1.

Generate a list of numbers - 256 entries

Please generate list of numbers from 1 to 20.

120 Degrees - 388 entries

Rotate that triangle.

Letterbox - 83 entries

Make a box!

Reverse characters in a line - 601 entries

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

The meaning - 508 entries

Numbers are fun!

imports alignment (python) - 583 entries

Align as one import per line.

Remove semicolons after expressions - 488 entries

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

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

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

Counting in binary - 402 entries

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

Remember FizzBuzz? - 548 entries

Output FizzBuzz to 100. Start with nothing.

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

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

ASCII box - 302 entries

Don't forget to fix typos!

Reformat most common surnames - 537 entries

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

readability - 291 entries

Make the code readable by adding some spaces

Line 'em up! - 279 entries

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

Interactive git rebase changing commands - 154 entries

How to change the action of some commits in git rebase dialog.

vim = 22 / 7 - 408 entries

pi square vim

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

Vim tetris - 345 entries

Vim can play tetris too!

Reformat some Python - 518 entries

Fix some very bizarrely laid-out code.

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

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

Increment, increment, increment.... - 507 entries

Vim likes macros

lipsum lines - 244 entries

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

NATO phonetic alphabet - 410 entries

Transform the series of words into a list.

Triangular Numbers - 63 entries

Generate the first 50 triangular numbers.

Logging with key - 277 entries

Sometimes it is better to log with meaningful key

Text to HTML Table - 155 entries

Turn the plain text table to an HTML table.

VimGolf Chatter