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]

30876 active golfers, 373246 entries, 515 challenges

Open VimGolf challenges

Overall Vimgolf Rank - 137 entries

Suppose you are trying to figure out what your overall rank is at Vimgolf(the sum of all the ranks you got), and as a Vim ninja you decided to use Vim to do the job. Your solution should work for every Vimgolf profile page(The actual input file for this challenge is my Vimgolf profile page). So, direct answer insertion is considered cheating.

Assignment Alignment - 722 entries

line up the operators. Use spaces, not tabs.

Before there was Farmville... - 92 entries

There was old MacDonald. For my toddler. The first Vim sing-a-long?

The Universal Declaration of Human Rights, Article 1 - 129 entries

Somebody's got this slightly muddled up. See how quickly you can fix it. (I made this to experiment with buffers. I'm not actually sure whether this is faster with buffers or without.)

Reformat long lines - 320 entries

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

Generate English Alphabets - 425 entries

Start with a, get up to z.

Here, piggy, piggy... - 75 entries

Youay owknay atwhay otay oday...

Word Blender - 128 entries

The insides of long words seem to have been run through the blender. Can you fix this famous tale, brave knight?

Happy New Year! - 129 entries

This is a simple new year's challenge.

Insert a Markdown link - 398 entries

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

It'ss tooo coold too typpe todaay - 199 entries

My hands are numb with cold. It's hard to type correctly.

Getters & Setters: Java - 189 entries

Boilerplate getters & setters - it's a tedious fact of life in Java, and probably the only thing that still pulls me back to an IDE. Perhaps someone knows a fast, pure vim way...

Cartesian product - 206 entries

{1,2,3,4,5} X {1,2,3,4,5}

Return the cow - 71 entries

This cow is too verbose. Give it a lesson.

Solve the Sokoban - 158 entries

A wink for all Vimgolfers that play Nethack too.

CSV to JSON - 143 entries

A search for shortest vimissh way to convert CSV to JSON.

Generate Fibonacci Numbers - 218 entries

Use your super vim powers to generate Fibonacci Numbers.

The holy-grail may help - 304 entries

Can you find it in less than 20 strokes, Arthur?

Shebangs for all - 1718 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

Ruby 1.9 hashes - 1113 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

Reverse and count - 403 entries

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

Letters are numbers - 127 entries

Letters and numbers are interchangeable. A lot of programming languages give you simple ways to convert individual letters to hex, binary and decimal but does Vim?

Almost encrypted - 176 entries

Convert the first paragraph to be even less readable.

Reverse Simple Deletion - 739 entries

You did the simple deletion, now reverse it.

Dumb to smart - 82 entries

Turn dumb quote to smart vim's way.

82 bottles of beer on the wall - 280 entries

Take them down. (sorry, only 82 bottles because the problem size is limited!)

Make Fancy Header - 929 entries

Make the header text stand out with surrounding asterisks

The Cake is a Lie - 1168 entries

Correct the capitalization of each word

Increment, increment, increment.... - 531 entries

Vim likes macros

Remove Accent off the Letter - 100 entries

Remove all the accent from extremely accented statements.

Compile C - 288 entries

You might have to get clever to do this one.

Another Mixed-Up Haiku - 206 entries

VimGolf ... a perfect evening?

Prime Numbers - 302 entries

List the first 100 prime numbers.

A Simple One - 870 entries

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

Round Round - 242 entries

Round Round

Table Reshuffle - 326 entries

Fix the column order in this table... also append the new 'username' column.

Fix the Haiku - 251 entries

Change this slightly scrambled haiku to its unscrambled form and fix the capitalisation and punctuation along the way.

Indentation - 420 entries

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

Linear congruential generator - 108 entries

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

Hatsuyume - 368 entries

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

Context Insensitive completion 1 - 405 entries

Finish writing this simple Python HTTP server.

Turn this csv list into queries - 190 entries

Transform each line of this csv file into a MySQL-ready INSERT query.

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.

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

Sorting paragraphs - 456 entries

Order the paragraphs correctly, per prefixed index

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

Reformat some Python - 534 entries

Fix some very bizarrely laid-out code.

Reformat a C golf submission - 492 entries

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

Reverse characters in a line - 602 entries

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

PEP8 Python Wrapping Comments and Code - 157 entries

According to PEP8, long flowy text and code should have different max line lengths. Code: 79 characters max Long flowy text: 72 characters max

VimGolf Chatter