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

HS exam question - 1508 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 73
  • Position: #216 / 396
  • Number of attempts: 3
Fizzbuzz - 509 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 47
  • Best player score: 86
  • Position: #100 / 157
  • Number of attempts: 2
Word Blender - 146 entries

The insides of long words seem to have been run through the blender. Can you fix this famous tale, brave knight?

  • Best score: 28
  • Best player score: 41
  • Position: #30 / 55
  • Number of attempts: 1
Cartesian product - 221 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 34
  • Position: #52 / 92
  • Number of attempts: 2
Pretty format for variable declarations - 155 entries

Project standards demand the equal signs must be aligned for better readability.

  • Best score: 13
  • Best player score: 18
  • Position: #44 / 62
  • Number of attempts: 2
I forgot quotes - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Position: #2389 / 4161
  • Number of attempts: 1
quotes inside quotes - 3125 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 15
  • Position: #436 / 1072
  • Number of attempts: 5
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: #24 / 58
  • 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: #59 / 189
  • Number of attempts: 3
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #153 / 441
  • Number of attempts: 1
replacing each line of a block selection - 2947 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #23 / 768
  • Number of attempts: 7
Append semicolon after expressions - 1005 entries

Some lines need the semicolon, some don't.

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

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 17
  • Position: #112 / 194
  • Number of attempts: 2
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: 15
  • Position: #7 / 270
  • Number of attempts: 3
Remove semicolons after expressions - 628 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 8
  • Position: #153 / 258
  • Number of attempts: 2
The meaning - 558 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #37 / 356
  • Number of attempts: 1
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: 24
  • Position: #210 / 331
  • Number of attempts: 4
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: 53
  • Position: #135 / 148
  • Number of attempts: 3
Complete the hex array data - 195 entries

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

  • Best score: 23
  • Best player score: 28
  • Position: #46 / 72
  • Number of attempts: 2
Sort entries based on date - 363 entries

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

  • Best score: 11
  • Best player score: 16
  • Position: #84 / 114
  • Number of attempts: 2
Happy New Year! - 143 entries

This is a simple new year's challenge.

  • Best score: 22
  • Best player score: 26
  • Position: #31 / 57
  • Number of attempts: 2
It'ss tooo coold too typpe todaay - 215 entries

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

  • Best score: 16
  • Best player score: 23
  • Position: #46 / 96
  • Number of attempts: 1
Reformat long lines - 341 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: 21
  • Position: #82 / 130
  • Number of attempts: 1
Generate English Alphabets - 473 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 25
  • Position: #73 / 202
  • Number of attempts: 1
Insert a Markdown link - 431 entries

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

  • Best score: 22
  • Best player score: 25
  • Position: #73 / 143
  • Number of attempts: 2
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Position: #283 / 639
  • Number of attempts: 6
The Universal Declaration of Human Rights, Article 1 - 148 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: #7 / 69
  • Number of attempts: 4
Getters & Setters: Java - 205 entries

Boilerplate getters & setters - it's a tedious fact of life in Java, and probably the only thing that still pulls me back to an IDE. Perhaps someone knows a fast, pure vim way...

  • Best score: 89
  • Best player score: 142
  • Position: #46 / 56
  • Number of attempts: 1
The holy-grail may help - 345 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #56 / 205
  • Number of attempts: 2
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: #194 / 401
  • Number of attempts: 1
Assignment Alignment - 832 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 30
  • Position: #152 / 215
  • Number of attempts: 1
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: 14
  • Position: #206 / 500
  • Number of attempts: 4
A Simple One - 1001 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 10
  • Position: #573 / 643
  • Number of attempts: 1
Table Reshuffle - 371 entries

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

  • Best score: 22
  • Best player score: 30
  • Position: #66 / 134
  • Number of attempts: 2
Reverse and count - 456 entries

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

  • Best score: 18
  • Best player score: 26
  • Position: #96 / 172
  • Number of attempts: 5
Letters are numbers - 150 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: #56 / 73
  • Number of attempts: 1
Another Mixed-Up Haiku - 237 entries

VimGolf ... a perfect evening?

  • Best score: 21
  • Best player score: 21
  • Position: #13 / 85
  • Number of attempts: 4
Ruby 1.9 compat - 610 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: 14
  • Position: #8 / 230
  • Number of attempts: 2
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 19
  • Position: #438 / 454
  • Number of attempts: 1
The Cake is a Lie - 1286 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #392 / 512
  • Number of attempts: 1
Compile C - 365 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 21
  • Position: #36 / 132
  • Number of attempts: 2
Make Fancy Header - 1014 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 17
  • Position: #151 / 338
  • Number of attempts: 5
Reformat some Python - 579 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 36
  • Position: #65 / 229
  • Number of attempts: 3
Change the content of a string - 1476 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Position: #336 / 558
  • Number of attempts: 1
Simple text editing with Vim - 12286 entries

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

  • Best score: 13
  • Best player score: 20
  • Position: #2670 / 3581
  • Number of attempts: 1

Contributed Challenges

Happy New Year! - 143 entries

This is a simple new year's challenge.

Mattiassich Ákos
Twitter:

entered into 45 challenges

contributed 1 challenges