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]

24375 active golfers, 267876 entries, 424 challenges

Open VimGolf challenges

Case preserving word replacement - 384 entries

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

FoodCritic023: Prefer conditional attributes - 161 entries

FoodCritic ( is a lint tool for your Chef ( 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 for more details about the changes being made.

Context Insensitive completion 1 - 391 entries

Finish writing this simple Python HTTP server.

Start coding format - 119 entries

I used to start coding with following format: int main(){ -(cursor here) }

Insert a Markdown link - 385 entries

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

Reverse and count - 379 entries

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

NBCU Weekly Challenge - Test - 215 entries

Just testing.

Sorting database text output - 188 entries

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

Hatsuyume - 363 entries

underscore_to_camelCase - 137 entries

Pointy haired boss decided we need to switch to camelCase. Let's get this over with.

JS notation to Immutable.js notation - 143 entries

Now Immutable.js made its way into many frontends. This challenge consists of a typical refactoring that many of us are facing now.

Rotating Philosophers Problem - 354 entries

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

Vim's not included features - 157 entries

Filter not included (-) features in a hypothetical installation of vim.

Sort the VimGolf challenges by popularity - 257 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 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!

Array of characters - 114 entries

We all copy paste things off the internet, but the syntax doesn't look right. Fix it as fast as possible.

Sort entries based on date - 304 entries

Sort some entries in a Ledger-file based on date.

learn vim in short time - 183 entries

so happy to learn vim.because vim is awesome

A grid of punctuation - 112 entries

Create a checkerboard of = and - in an 80×24 grid!

Change your calendar - 255 entries

Happy New Year!

Neither Fizz nor Buzz - 191 entries

Not your regular increment macro! The gaps are tricky.

Restore order to the alphabet - 153 entries

The numbers are OK. The letters are wonky.

Refactor static member invocation - 180 entries

Someone used a static method. Refactor the method into a static import while fixing the assertion.

Table Reshuffle - 325 entries

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

Reformat long lines - 316 entries

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

Get rid of html tags - 315 entries

Want to read more about Vim's background? Then get rid of those html tags...

abcd > a b c d - 240 entries

transform the single spaces into 4 spaces repeat for each line

Shift down - 168 entries

Number words are back.

remove all lines in first part - 148 entries

From the second part, remove all lines in the first part. It can be useful when you have done something from a long list, you want to know what is not done yet!

Wget failed to download redirections - 158 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

Change attribute to getter - 85 entries

Wrap attributes with a getter method.

The holy-grail may help - 298 entries

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

Free hyphen! - 112 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

Readable Rubyhash - 227 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!

Suffix sort - 165 entries

Sort from the end of the line, as if the letters in each line were reversed.

Inner hyphens - 111 entries

Yet another hyphen challenge. Adding 5 hyphens to a file shouldn't be too hard.

Create Leading Zeros - 192 entries

Create leading zeros only for id columns. Please use generic approach!

Enumerate words - 219 entries

Enumerate the unique words in order.

Number an outline - 199 entries

The indent and words are right, but the numbers are all wrong.

Compile C - 275 entries

You might have to get clever to do this one.

Deleting folded text - 274 entries

The text below contains three folds. Delete them (and the text inside them). For example: 123 456 /*{{{*/ 789 /*}}}*/ 012 Should become: 123 012 Also, add `aoeuaoeu` to make sure small solutions don't get flagged as cheating.

Alphabetize the directory - 252 entries

Put the contacts and their information in alphabetical order.

create arrows in a list - 63 entries

Add arrow at same distance

increment by column in XML - 138 entries

modify an arbitrary "column" in an xml table by incrementing a an arbitrary placeholder string

Extract HTML option values from tag values - 73 entries

Generate HTML option values from the text in the option tag. If the text contains multiple words, replace the spaces with an underscore and convert all capital letters to small letters.

Prime Numbers - 263 entries

List the first 100 prime numbers.

Word frequency alignment - 197 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

Sorting a glossary - 100 entries

Sort a glossary. Glossary head contains a header phrase ending with ':' and glossary body has multi line text indented with a tab.

Subtraction - 147 entries

Solve the equations.

Top X - 177 entries

The End File is the Top 10 Vimgolf Leaderboard at June 29, 2013. This is a second version, with a great contribution of @udioica. X is ten in Roman,a numeric system in ancient Rome

Change name of a variable - 145 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

VimGolf Chatter