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]

29248 active golfers, 350571 entries, 493 challenges

Open VimGolf challenges

readability - 292 entries

Make the code readable by adding some spaces

vim = 22 / 7 - 408 entries

pi square vim

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

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

replace 2nd column blanks with values in same column if blank - 200 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 - 347 entries

Vim can play tetris too!

Letterbox - 83 entries

Make a box!

NATO phonetic alphabet - 418 entries

Transform the series of words into a list.

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.

Pretty multi-line bash - 210 entries

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

Reverse and double space - 424 entries

Reverse the order of the given lines and double space everything

Interactive git rebase changing commands - 155 entries

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

Logging with key - 280 entries

Sometimes it is better to log with meaningful key

lipsum lines - 245 entries

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

Reformat a C golf submission - 489 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

Split the words - 345 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.

PHP Array Syntax -> MailChimp Merge Syntax - 440 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

Stairs Indenting - 384 entries

Indent each line with <line number> whitespaces.

Delete unwanted lines - 350 entries

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

Shuffle puzzle - 302 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.

A simple change - 377 entries

Just change the numbers in the most efficient way ...

Text to HTML Table - 156 entries

Turn the plain text table to an HTML table.

Context insensitive completion 0 - 461 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

Pairs of numbers - 340 entries

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

Sorting paragraphs - 455 entries

Order the paragraphs correctly, per prefixed index

Replacing some words - 405 entries

How fast could it be?

Add fold markers to a .c file - 447 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

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

Going underground.... - 303 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

Generate English Alphabets - 425 entries

Start with a, get up to z.

Indentation - 420 entries

Indent each line according to the right number of spaces it needs.

Line Zipper - 402 entries

Zip/pair related lines.

Triangular Numbers - 64 entries

Generate the first 50 triangular numbers.

Santa's naughty / nice list - 75 entries

Christmas is here and Santa hasn't decided who's naughty or nice yet. He's given a list of names to his programmer friend to quickly split the children into naughty and nice. Hint: There's a hidden pattern that might be familiar.

Sort the VimGolf challenges by popularity - 319 entries

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

The Quick Brown Fox Jumps Over The Lazy Vim - 339 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

Case preserving word replacement - 395 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

Context Insensitive completion 1 - 405 entries

Finish writing this simple Python HTTP server.

you're stuck on jQuery < 1.7 - 325 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

vim1001 - 244 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

Separate the lines - 131 entries

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

Add Go XML to structure tags - 131 entries

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

Insert a Markdown link - 390 entries

Put a link in a markdown document, using the after-the-paragraph format.

Reverse and count - 384 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

Rotating Philosophers Problem - 367 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

Hatsuyume - 368 entries

http://en.wikipedia.org/wiki/Hatsuyume

Shuffled numbers - 203 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

NBCU Weekly Challenge - Test - 227 entries

Just testing.

Change your calendar - 278 entries

Happy New Year!

Sort files from hosts - 137 entries

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

FoodCritic023: Prefer conditional attributes - 166 entries

FoodCritic (www.foodcritic.io) is a lint tool for your Chef (learn.chef.io) cookbooks. FC023 indicates that you should prefer Chef guards over Ruby conditions. This challenge expects you to be able to fix this issue in a sample cookbook, given the FoodCritic output: ================================================================ FC023: Prefer conditional attributes: cookbooks/foo/recipes/default.rb:25 ================================================================ See http://www.foodcritic.io/#FC023 for more details about the changes being made.

VimGolf Chatter