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]

38234 active golfers, 454033 entries, 580 challenges

Open VimGolf challenges

formatted text to markdown - 184 entries

You're converting some posts from an old blog to markdown. The formatted text is far closer to the finished product than the html markup, so it seems like a good place to start. Word wrapping seems to be the main area for optimization.

Multiplication table. - 206 entries

Create a multiplication table.

Line Zipper - 454 entries

Zip/pair related lines.

Complete the hex array data (Part II) - 157 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

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

Complete the hex array data - 196 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

Case preserving word replacement - 454 entries

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

Sort the cardinal numbers - 294 entries

Maybe a simple challenge.

Numbering a List - 1867 entries

Pretty simple, number the list.

Recursively Palindrome - 245 entries

Note that there are 2^6-1 characters.

Java Array2List - 227 entries

Convert an java array initializer into a list.

imports alignment (python) - 663 entries

Align as one import per line.

expand a list comprehension (python) - 302 entries

Please show your way to convert a list comprehension in python to an ordinary for-loop expression!

HTML to Haml - 843 entries

Help convert this HTML page to Haml.

Rotating Philosophers Problem - 392 entries

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

Overall Vimgolf Rank - 171 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 - 842 entries

line up the operators. Use spaces, not tabs.

Before there was Farmville... - 98 entries

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

The Universal Declaration of Human Rights, Article 1 - 149 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 - 346 entries

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

Generate English Alphabets - 476 entries

Start with a, get up to z.

Here, piggy, piggy... - 76 entries

Youay owknay atwhay otay oday...

Word Blender - 147 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! - 144 entries

This is a simple new year's challenge.

Insert a Markdown link - 434 entries

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

It'ss tooo coold too typpe todaay - 222 entries

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

Getters & Setters: Java - 206 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 - 222 entries

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

Return the cow - 72 entries

This cow is too verbose. Give it a lesson.

Solve the Sokoban - 165 entries

A wink for all Vimgolfers that play Nethack too.

CSV to JSON - 173 entries

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

Generate Fibonacci Numbers - 263 entries

Use your super vim powers to generate Fibonacci Numbers.

The holy-grail may help - 352 entries

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

Shebangs for all - 1917 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 - 1225 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 - 459 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 - 154 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 - 199 entries

Convert the first paragraph to be even less readable.

Reverse Simple Deletion - 834 entries

You did the simple deletion, now reverse it.

Dumb to smart - 97 entries

Turn dumb quote to smart vim's way.

82 bottles of beer on the wall - 307 entries

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

Make Fancy Header - 1024 entries

Make the header text stand out with surrounding asterisks

The Cake is a Lie - 1301 entries

Correct the capitalization of each word

Increment, increment, increment.... - 668 entries

Vim likes macros

Remove Accent off the Letter - 107 entries

Remove all the accent from extremely accented statements.

Compile C - 366 entries

You might have to get clever to do this one.

Another Mixed-Up Haiku - 238 entries

VimGolf ... a perfect evening?

Prime Numbers - 345 entries

List the first 100 prime numbers.

A Simple One - 1009 entries

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

Round Round - 288 entries

Round Round

VimGolf Chatter