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]

23264 active golfers, 247717 entries, 404 challenges

Open VimGolf challenges

Combines all items - 231 entries

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

Exchanging Quotes - 746 entries

Sometimes you need to exchange a choice of quotes in some code.

Make Fancy Header - 890 entries

Make the header text stand out with surrounding asterisks

Wrap text in quotes - 276 entries

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

Replace and keep the case - 330 entries

Replace all instance of plugin and Plugin to device and Device.

A Simple One - 827 entries

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

Mute the second method of this script - 404 entries

prepend a # infront of every line of the second method

Python Hello World! Reformatting - 822 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.

Interactive git rebase changing commands - 139 entries

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

Flodder-challenge - 797 entries

Replace the text the most efficient and win!

Ugly spreadsheet copy/paste to CSV - 679 entries

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

Generate a list of numbers - 227 entries

Please generate list of numbers from 1 to 20.

The name of the game - 574 entries

End up with the name of the game.

Remove noise from HTTP log - 595 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 - 694 entries

You did the simple deletion, now reverse it.

Happy TvvO - 341 entries

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

HTML to Haml - 667 entries

Help convert this HTML page to Haml.

VimGolfNight - 450 entries

Based on "The name of the game".

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.

Text to HTML Table - 130 entries

Turn the plain text table to an HTML table.

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!

Assignment Alignment - 651 entries

line up the operators. Use spaces, not tabs.

Lisp Condense - 360 entries

Reduce 4 cons selection operations down to one function call.

Swap assigned value - 485 entries

Simple problem but looking for interesting solutions.

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.

Separate the lines - 121 entries

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

Pretty multi-line bash - 190 entries

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

Prefixes and suffixes - 465 entries

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

Braces or Brackets? - 618 entries

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

120 Degrees - 339 entries

Rotate that triangle.

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?

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!

Minimalist Limerick - 442 entries

Reproduce this lovely poem.

lamb had a little Mary - 450 entries

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

lipsum lines - 233 entries

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

ASCII box - 287 entries

Don't forget to fix typos!

The meaning - 489 entries

Numbers are fun!

imports alignment (python) - 571 entries

Align as one import per line.

Reverse characters in a line - 554 entries

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

Logging with key - 264 entries

Sometimes it is better to log with meaningful key

Un"finnish"ed Work - 99 entries

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

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

Subnetting - 57 entries

Split up the IP addresses in the right way.

vim = 22 / 7 - 392 entries

pi square vim

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

Remove semicolons after expressions - 432 entries

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

Remember FizzBuzz? - 513 entries

Output FizzBuzz to 100. Start with nothing.

Reformat most common surnames - 511 entries

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

For all cases. - 99 entries

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

VimGolf Chatter