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]

30084 active golfers, 367045 entries, 507 challenges

Open VimGolf challenges

Reverse and count - 384 entries

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

Add Go XML to structure tags - 133 entries

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

Separate the lines - 132 entries

Every other line is mixed up. Separate them into their original texts.

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

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.

Triangular Numbers - 64 entries

Generate the first 50 triangular numbers.

Shuffled numbers - 203 entries

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

NBCU Weekly Challenge - Test - 227 entries

Just testing.

Change your calendar - 278 entries

Happy New Year!

Sort entries based on date - 315 entries

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

learn vim in short time - 207 entries

so happy to learn vim.because vim is awesome

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

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?

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.

For all cases. - 116 entries

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

Table Reshuffle - 326 entries

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

Get rid of html tags - 319 entries

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

Reformat long lines - 317 entries

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

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 - 248 entries

transform the single spaces into 4 spaces repeat for each line

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.

The holy-grail may help - 304 entries

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

Start coding format - 128 entries

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

Un"finnish"ed Work - 104 entries

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

Prime Numbers - 302 entries

List the first 100 prime numbers.

underscore_to_camelCase - 145 entries

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

Refactor static member invocation - 187 entries

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

Array of characters - 132 entries

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

vimtutor, but you can cheat - 4 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

Restore order to the alphabet - 161 entries

The numbers are OK. The letters are wonky.

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!

Compile C - 287 entries

You might have to get clever to do this one.

Free hyphen! - 138 entries

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

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

Enumerate words - 226 entries

Enumerate the unique words in order.

82 bottles of beer on the wall - 281 entries

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

Alphabetize the directory - 261 entries

Put the contacts and their information in alphabetical order.

Deleting folded text - 279 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.

Suffix sort - 177 entries

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

Subnetting - 79 entries

Split up the IP addresses in the right way.

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

Kolakoski sequence -- level 1 - 51 entries

Generate the Kolakoski sequence as described by its first 75 terms.

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

Create Leading Zeros - 197 entries

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

expand a list comprehension (python) - 267 entries

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

Number an outline - 201 entries

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

VimGolf Chatter