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]

Played Challenges

vim = 22 / 7 - 447 entries

pi square vim

  • Best score: 20
  • Best player score: 23
  • Position: #56 / 131
  • Number of attempts: 2
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1620 / 4164
  • Number of attempts: 1
Interweave two blocks of text - 631 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?

  • Best score: 15
  • Best player score: 24
  • Position: #192 / 211
  • Number of attempts: 2
Python Hello World! Reformatting - 938 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 45
  • Position: #271 / 364
  • Number of attempts: 1
Change your calendar - 362 entries

Happy New Year!

  • Best score: 18
  • Best player score: 37
  • Position: #56 / 85
  • Number of attempts: 1
Vim tetris - 352 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 26
  • Position: #52 / 101
  • Number of attempts: 1
Mess in revision history - 1160 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 25
  • Position: #143 / 246
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1732 / 3666
  • Number of attempts: 1
Words in parens - 12854 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1864 / 3945
  • Number of attempts: 2
Pairs of numbers - 360 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 55
  • Position: #118 / 133
  • Number of attempts: 1
Minimalist Limerick - 516 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 35
  • Position: #71 / 171
  • Number of attempts: 2
Define to require - 118 entries

When JSHint is enabled, there's a rule that doesn't let you have more than 6 arguments in a function, so the moment you need to add a 7th argument, you need to do a refactoring.

  • Best score: 62
  • Best player score: 75
  • Position: #16 / 48
  • Number of attempts: 3
Groups magic - 150 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 16
  • Position: #80 / 90
  • Number of attempts: 1
Prefixes and suffixes - 591 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 26
  • Position: #75 / 192
  • Number of attempts: 3
Refactor arguments into object argument - 161 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 65
  • Position: #27 / 65
  • Number of attempts: 2
Readable Rubyhash - 244 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!

  • Best score: 23
  • Best player score: 26
  • Position: #14 / 92
  • Number of attempts: 4
Dehamlizing - 180 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 45
  • Position: #51 / 69
  • Number of attempts: 1
Checkerboard case pattern - 148 entries

All the squares are white. Make some of them black. But only the right ones.

  • Best score: 15
  • Best player score: 17
  • Position: #18 / 58
  • Number of attempts: 2
Shuffle and Sort - 209 entries

The values where sorted incorrectly. Get them back to how they are supposed to be

  • Best score: 17
  • Best player score: 24
  • Position: #30 / 65
  • Number of attempts: 2
A simple change - 442 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 14
  • Position: #64 / 189
  • Number of attempts: 1
lamb had a little Mary - 586 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 36
  • Position: #89 / 163
  • Number of attempts: 1
Convert pandoc unordered list to a numbered list - 165 entries

I know it's possible to use #. in pandoc to auto-generate numbered lists, but then it's not easy to tell how many items there are when reading it in Markdown. How fast can you make the switch?

  • Best score: 20
  • Best player score: 32
  • Position: #39 / 56
  • Number of attempts: 1
Inconsistent real estate paste - 184 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

  • Best score: 24
  • Best player score: 35
  • Position: #28 / 55
  • Number of attempts: 2
Vertical Limit - 2437 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 26
  • Position: #385 / 736
  • Number of attempts: 2
Aligning function arguments to match a specific coding style - 227 entries

Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.

  • Best score: 16
  • Best player score: 25
  • Position: #57 / 68
  • Number of attempts: 1
Exchanging Quotes - 821 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 36
  • Position: #101 / 225
  • Number of attempts: 8
Append semicolon after expressions - 1005 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #263 / 403
  • Number of attempts: 2
Reverse and double space - 489 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 18
  • Position: #155 / 194
  • Number of attempts: 1
Remove noise from HTTP log - 695 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 17
  • Position: #197 / 270
  • Number of attempts: 1
switch variable - 5031 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1002 / 1735
  • Number of attempts: 3
Format the output - 145 entries

Sometimes your standard out is a little hard to read. Take this multilevel hash and make it human readable.

  • Best score: 35
  • Best player score: 75
  • Position: #32 / 39
  • Number of attempts: 1
Ugly spreadsheet copy/paste to CSV - 973 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 51
  • Position: #154 / 185
  • Number of attempts: 1
PHP <--> Java class conversion Part 1 - 212 entries

Convert this tiny php class to adequate java one.

  • Best score: 65
  • Best player score: 95
  • Position: #32 / 61
  • Number of attempts: 1
Multiplication table. - 205 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 78
  • Position: #39 / 63
  • Number of attempts: 4
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #319 / 640
  • Number of attempts: 4
remove dupes from array - 1336 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 20
  • Position: #126 / 331
  • Number of attempts: 2
PHP Array Syntax -> MailChimp Merge Syntax - 507 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!

  • Best score: 23
  • Best player score: 27
  • Position: #57 / 148
  • Number of attempts: 4
Complete the hex array data (Part II) - 156 entries

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

  • Best score: 20
  • Best player score: 26
  • Position: #45 / 67
  • Number of attempts: 1
imports alignment (python) - 661 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 26
  • Position: #129 / 194
  • Number of attempts: 2
HTML to Haml - 842 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 48
  • Position: #159 / 202
  • Number of attempts: 2
expand a list comprehension (python) - 301 entries

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

  • Best score: 42
  • Best player score: 51
  • Position: #44 / 106
  • Number of attempts: 2
Generate English Alphabets - 472 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 26
  • Position: #155 / 202
  • Number of attempts: 1
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Position: #288 / 639
  • Number of attempts: 3
Ruby 1.9 hashes - 1221 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!

  • Best score: 12
  • Best player score: 14
  • Position: #213 / 401
  • Number of attempts: 2
Shebangs for all - 1912 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.

  • Best score: 11
  • Best player score: 12
  • Position: #118 / 500
  • Number of attempts: 1
Round Round - 287 entries

Round Round

  • Best score: 19
  • Best player score: 116
  • Position: #69 / 84
  • Number of attempts: 1
82 bottles of beer on the wall - 303 entries

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

  • Best score: 106
  • Best player score: 130
  • Position: #71 / 141
  • Number of attempts: 1
Fix the Haiku - 275 entries

Change this slightly scrambled haiku to its unscrambled form and fix the capitalisation and punctuation along the way.

  • Best score: 28
  • Best player score: 43
  • Position: #68 / 109
  • Number of attempts: 1
Make Fancy Header - 1014 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 17
  • Position: #170 / 338
  • Number of attempts: 2
Reverse characters in a line - 709 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 16
  • Position: #144 / 249
  • Number of attempts: 1
Reformat most common surnames - 647 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 28
  • Position: #89 / 198
  • Number of attempts: 1
Change the content of a string - 1475 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #247 / 557
  • Number of attempts: 2
Simple text editing with Vim - 12281 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 14
  • Position: #927 / 3580
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 6557 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 38
  • Position: #588 / 1614
  • Number of attempts: 3
Daniel Lundin
Twitter:

Software developer and music enthusiast. Author of animation library snabbt.js

entered into 54 challenges

contributed 0 challenges