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]

21586 active golfers, 220883 entries, 385 challenges

Open VimGolf challenges

PHP Array Syntax -> MailChimp Merge Syntax - 407 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!

Start coding format - 101 entries

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

Going underground.... - 277 entries

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

create arrows in a list - 62 entries

Add arrow at same distance

FoodCritic023: Prefer conditional attributes - 150 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.

Mirrored text - 135 entries

backward and forward, and long enough to be challenging

underscore_to_camelCase - 134 entries

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

Increment, increment, increment.... - 442 entries

Vim likes macros

Add fold markers to a .c file - 439 entries

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

Sorting paragraphs - 437 entries

Order the paragraphs correctly, per prefixed index

vim1001 - 219 entries

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

A grid of punctuation - 109 entries

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

Context insensitive completion 0 - 430 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.

Change attribute to getter - 82 entries

Wrap attributes with a getter method.

JS notation to Immutable.js notation - 137 entries

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

Array of characters - 107 entries

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

NBCU Weekly Challenge - Test - 214 entries

Just testing.

Sorting database text output - 183 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?

Back to the roots - 30 entries

Johnny has a file with more integers. He wants to change each number with its square root. Can you help him?

you're stuck on jQuery < 1.7 - 314 entries

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

Line Zipper - 386 entries

Zip/pair related lines.

The Quick Brown Fox Jumps Over The Lazy Vim - 313 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."

Indentation - 405 entries

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

Vim's not included features - 150 entries

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

Case preserving word replacement - 382 entries

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

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.

Generate English Alphabets - 387 entries

Start with a, get up to z.

Format java properties - 62 entries

Format java properties to a different format. The value which is the string following the first '=' cannot & should not change. All periods in the key get replaced with an underscore "_" and get a prefix of "b_".

Reverse and count - 377 entries

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

Insert a Markdown link - 375 entries

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

Sort yaml structures alphabetically by root key names - 25 entries

sometimes we want to sort structures alphabetically in yaml files

Context Insensitive completion 1 - 373 entries

Finish writing this simple Python HTTP server.

Restore order to the alphabet - 149 entries

The numbers are OK. The letters are wonky.

Inner hyphens - 110 entries

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

Hatsuyume - 360 entries

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

learn vim in short time - 173 entries

so happy to learn vim.because vim is awesome

Free hyphen! - 106 entries

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

Rotating Philosophers Problem - 346 entries

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

Neither Fizz nor Buzz - 183 entries

Not your regular increment macro! The gaps are tricky.

42-header - 26 entries

Rush 42mexican-standoff at 42 school

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

Hidden Message - 43 entries

Find the hidden message and replace all other characters with spaces.

Wget failed to download redirections - 153 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.

Sort entries based on date - 292 entries

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

Shift down - 158 entries

Number words are back.

Refactor static member invocation - 161 entries

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

Suffix sort - 163 entries

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

Table Reshuffle - 310 entries

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

abcd > a b c d - 229 entries

transform the single spaces into 4 spaces repeat for each line

Reformat long lines - 305 entries

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

VimGolf Chatter