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

Interweave two blocks of text - 659 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: 17
  • Position: #77 / 214
  • Number of attempts: 2
Recursively Palindrome - 267 entries

Note that there are 2^6-1 characters.

  • Best score: 21
  • Best player score: 23
  • Position: #17 / 75
  • Number of attempts: 9
replacing each line of a block selection - 2999 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 18
  • Position: #37 / 777
  • Number of attempts: 11
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #41 / 1748
  • Number of attempts: 7
Ugly spreadsheet copy/paste to CSV - 1009 entries

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

  • Best score: 19
  • Best player score: 21
  • Position: #48 / 193
  • Number of attempts: 7
Sort the cardinal numbers - 310 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Position: #76 / 148
  • Number of attempts: 1
Make it more readable - 2005 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #5 / 650
  • Number of attempts: 5
Line Zipper - 473 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 14
  • Position: #73 / 215
  • Number of attempts: 3
PHP Array Syntax -> MailChimp Merge Syntax - 545 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: 25
  • Position: #49 / 150
  • Number of attempts: 3
Case preserving word replacement - 454 entries

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

  • Best score: 19
  • Best player score: 19
  • Position: #13 / 180
  • Number of attempts: 6
Complete the hex array data (Part II) - 166 entries

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

  • Best score: 20
  • Best player score: 22
  • Position: #14 / 69
  • Number of attempts: 1
Sort entries based on date - 392 entries

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

  • Best score: 11
  • Best player score: 11
  • Position: #10 / 117
  • Number of attempts: 3
Happy New Year! - 145 entries

This is a simple new year's challenge.

  • Best score: 22
  • Best player score: 24
  • Position: #25 / 59
  • Number of attempts: 4
imports alignment (python) - 700 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Position: #16 / 198
  • Number of attempts: 5
It'ss tooo coold too typpe todaay - 222 entries

My hands are numb with cold. It's hard to type correctly.

  • Best score: 16
  • Best player score: 23
  • Position: #56 / 97
  • Number of attempts: 2
Rotating Philosophers Problem - 410 entries

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

  • Best score: 29
  • Best player score: 30
  • Position: #58 / 166
  • Number of attempts: 2
HTML to Haml - 878 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 27
  • Position: #28 / 204
  • Number of attempts: 8
Reformat long lines - 358 entries

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

  • Best score: 15
  • Best player score: 17
  • Position: #59 / 134
  • Number of attempts: 4
Generate English Alphabets - 487 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 24
  • Position: #49 / 206
  • Number of attempts: 3
Insert a Markdown link - 434 entries

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

  • Best score: 22
  • Best player score: 24
  • Position: #54 / 145
  • Number of attempts: 4
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Position: #289 / 652
  • Number of attempts: 4
The Universal Declaration of Human Rights, Article 1 - 163 entries

Somebody's got this slightly muddled up. See how quickly you can fix it. (I made this to experiment with buffers. I'm not actually sure whether this is faster with buffers or without.)

  • Best score: 24
  • Best player score: 24
  • Position: #14 / 71
  • Number of attempts: 3
Solve the Sokoban - 177 entries

A wink for all Vimgolfers that play Nethack too.

  • Best score: 25
  • Best player score: 30
  • Position: #28 / 74
  • Number of attempts: 3
The holy-grail may help - 362 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #81 / 208
  • Number of attempts: 4
Ruby 1.9 hashes - 1244 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: 12
  • Position: #21 / 406
  • Number of attempts: 9
CSV to JSON - 173 entries

A search for shortest vimissh way to convert CSV to JSON.

  • Best score: 56
  • Best player score: 79
  • Position: #17 / 66
  • Number of attempts: 4
Assignment Alignment - 883 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 19
  • Position: #63 / 220
  • Number of attempts: 13
Shebangs for all - 1998 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: #105 / 515
  • Number of attempts: 8
Letters are numbers - 167 entries

Letters and numbers are interchangeable. A lot of programming languages give you simple ways to convert individual letters to hex, binary and decimal but does Vim?

  • Best score: 20
  • Best player score: 32
  • Position: #60 / 76
  • Number of attempts: 1
Another Mixed-Up Haiku - 257 entries

VimGolf ... a perfect evening?

  • Best score: 21
  • Best player score: 21
  • Position: #16 / 89
  • Number of attempts: 4
Ruby 1.9 compat - 627 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 15
  • Position: #97 / 233
  • Number of attempts: 2
Context insensitive completion 0 - 566 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.

  • Best score: 6
  • Best player score: 7
  • Position: #46 / 244
  • Number of attempts: 2
Compile C - 420 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 21
  • Position: #47 / 140
  • Number of attempts: 2
Context Insensitive completion 1 - 494 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #66 / 243
  • Number of attempts: 3
Make Fancy Header - 1046 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #39 / 343
  • Number of attempts: 7
Whitespace, empty lines and tabs - 3614 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 19
  • Position: #182 / 780
  • Number of attempts: 14
Simple text editing with Vim - 12760 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #855 / 3684
  • Number of attempts: 4

Contributed Challenges

Line Zipper - 473 entries

Zip/pair related lines.

Dragan Cvetinovic
Twitter:

entered into 37 challenges

contributed 1 challenges