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]

30687 active golfers, 372803 entries, 513 challenges

Open VimGolf challenges

Letterbox - 83 entries

Make a box!

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.

Insert a Markdown link - 398 entries

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

vim1001 - 250 entries

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

you're stuck on jQuery < 1.7 - 325 entries

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

Add Go XML to structure tags - 143 entries

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

Mr. Hacker - 26 entries

Elvin is hacker. He has piece of users database from some social net site. Recently he installed Vim, and he wants to convert CSV DB to specific format `key=value' where `key' is login and `value' is password, but password in DB is encrypted in ROT13. Help him.

Triangular Numbers - 75 entries

Generate the first 50 triangular numbers.

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

vimtutor, but you can cheat - 13 entries

It's time to revisit vimtutor, but as an experienced Vim user! Your goal is to change the file to appear as if you had gone through the tutorial, but you do NOT need to actually complete the tutorial as written or do anything that doesn't result in changes to the file. You may use whatever you have in your Vim toolbelt that's allowed under VimGolf rules. The whole tutorial is too large to submit, so only the relevant lesson headers and associated practice lines are presented in this challenge. You will have to reference the tutor for the original instructions if you need them: https://raw.githubusercontent.com/vim/vim/4466ad6baa22485abb1147aca3340cced4778a66/runtime/tutor/tutor

NBCU Weekly Challenge - Test - 227 entries

Just testing.

Shuffled numbers - 203 entries

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

Change your calendar - 278 entries

Happy New Year!

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.

Sort entries based on date - 315 entries

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

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.

learn vim in short time - 209 entries

so happy to learn vim.because vim is awesome

Table Reshuffle - 326 entries

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

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

Sort files from hosts - 137 entries

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

Mirrored text - 159 entries

backward and forward, and long enough to be challenging

For all cases. - 119 entries

In this case... change it! :) Watch the line.

Reformat long lines - 320 entries

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

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.

Get rid of html tags - 319 entries

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

Neither Fizz nor Buzz - 205 entries

Not your regular increment macro! The gaps are tricky.

Vim's not included features - 168 entries

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

abcd > a b c d - 249 entries

transform the single spaces into 4 spaces repeat for each line

The holy-grail may help - 304 entries

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

Suffix sort - 195 entries

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

Prime Numbers - 302 entries

List the first 100 prime numbers.

Shift down - 189 entries

Number words are back.

JS notation to Immutable.js notation - 151 entries

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

Refactor static member invocation - 187 entries

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

Start coding format - 128 entries

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

underscore_to_camelCase - 145 entries

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

Subnetting - 88 entries

Split up the IP addresses in the right way.

Un"finnish"ed Work - 104 entries

Replace å by a, ä by a and ö by o.

Array of characters - 133 entries

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

Compile C - 288 entries

You might have to get clever to do this one.

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

Restore order to the alphabet - 161 entries

The numbers are OK. The letters are wonky.

Free hyphen! - 139 entries

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

82 bottles of beer on the wall - 281 entries

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

Word frequency alignment - 225 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...

Enumerate words - 226 entries

Enumerate the unique words in order.

Create Leading Zeros - 204 entries

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

Alphabetize the directory - 261 entries

Put the contacts and their information in alphabetical order.

remove all lines in first part - 162 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!

VimGolf Chatter