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

Wrap the text of an email message to 79 characters - 676 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #126 / 384
  • Number of attempts: 1
Search and Replace 0 - 4790 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 14
  • Position: #910 / 1585
  • Number of attempts: 4
Python Hello World! Reformatting - 936 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: 46
  • Position: #288 / 363
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10616 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1612 / 3663
  • Number of attempts: 3
Words in parens - 12848 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 22
  • Position: #3518 / 3943
  • Number of attempts: 1
Complete the circuit grid! - 81 entries

Continuing from the last challenge, add additional rows to the grid. Change each of the names from 'A1'...'A10' to 'B1'...'B10', 'C1'...'C10', etc, and for each new row add 0.7 to the X values in the (X Y) at the end of each line.

  • Best score: 49
  • Best player score: 81
  • Position: #23 / 28
  • Number of attempts: 1
Convert pandoc unordered list to a numbered list - 163 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: 42
  • Position: #44 / 56
  • Number of attempts: 1
Create an alphabet diamond - 79 entries

Here's a brain teaser to keep things interesting...

  • Best score: 40
  • Best player score: 568
  • Position: #30 / 30
  • Number of attempts: 1
Vertical Limit - 2436 entries

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

  • Best score: 21
  • Best player score: 34
  • Position: #688 / 735
  • Number of attempts: 3
Aligning function arguments to match a specific coding style - 220 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: 32
  • Position: #63 / 67
  • Number of attempts: 1
replacing each line of a block selection - 2925 entries

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

  • Best score: 18
  • Best player score: 23
  • Position: #441 / 764
  • Number of attempts: 3
Switch function arguments - 2064 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 15
  • Position: #525 / 647
  • Number of attempts: 4
Append semicolon after expressions - 1002 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #284 / 401
  • 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: 19
  • Position: #170 / 194
  • Number of attempts: 1
Remove noise from HTTP log - 693 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: #201 / 270
  • Number of attempts: 1
Remove semicolons after expressions - 628 entries

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

  • Best score: 6
  • Best player score: 6
  • Position: #41 / 258
  • Number of attempts: 3
switch variable - 5028 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 21
  • Position: #1665 / 1734
  • Number of attempts: 1
The meaning - 554 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #137 / 355
  • Number of attempts: 2
Case preserving word replacement - 453 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: 27
  • Position: #167 / 179
  • Number of attempts: 1
Complete the hex array data (Part II) - 154 entries

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

  • Best score: 20
  • Best player score: 26
  • Position: #46 / 67
  • Number of attempts: 2
Rotating Philosophers Problem - 388 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: 33
  • Position: #130 / 163
  • Number of attempts: 1
HTML to Haml - 842 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 51
  • Position: #173 / 202
  • Number of attempts: 1
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: 70
  • Position: #97 / 106
  • 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: 23
  • Position: #115 / 130
  • Number of attempts: 2
Generate English Alphabets - 463 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 25
  • Position: #118 / 198
  • Number of attempts: 1
Numbering a List - 1855 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 25
  • Position: #508 / 638
  • 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: #115 / 205
  • Number of attempts: 1
Ruby 1.9 hashes - 1216 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: 17
  • Position: #317 / 398
  • Number of attempts: 1
Shebangs for all - 1904 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: 18
  • Position: #357 / 497
  • Number of attempts: 1
A Simple One - 996 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: 9
  • Position: #283 / 641
  • Number of attempts: 1
82 bottles of beer on the wall - 302 entries

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

  • Best score: 106
  • Best player score: 160
  • Position: #120 / 140
  • Number of attempts: 1
Table Reshuffle - 369 entries

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

  • Best score: 22
  • Best player score: 49
  • Position: #124 / 133
  • Number of attempts: 1
Ruby 1.9 compat - 609 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: 17
  • Position: #141 / 229
  • Number of attempts: 2
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 15
  • Position: #414 / 454
  • Number of attempts: 3
Increment, increment, increment.... - 643 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #228 / 398
  • Number of attempts: 1
Sorting paragraphs - 505 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 36
  • Position: #104 / 156
  • Number of attempts: 1
Indentation - 497 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 21
  • Best player score: 29
  • Position: #93 / 168
  • Number of attempts: 4
Hatsuyume - 450 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 16
  • Best player score: 45
  • Position: #167 / 174
  • Number of attempts: 1
The Cake is a Lie - 1284 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 12
  • Position: #467 / 511
  • Number of attempts: 2
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: 57
  • Position: #103 / 109
  • Number of attempts: 1
Context insensitive completion 0 - 502 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: #71 / 231
  • Number of attempts: 4
Compile C - 365 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 33
  • Position: #126 / 132
  • Number of attempts: 2
Context Insensitive completion 1 - 456 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #89 / 231
  • Number of attempts: 1
Make Fancy Header - 1007 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 24
  • Position: #294 / 337
  • Number of attempts: 1
Reformat some Python - 579 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 42
  • Position: #113 / 229
  • Number of attempts: 3
Reformat a C golf submission - 552 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 22
  • Best player score: 39
  • Position: #157 / 199
  • Number of attempts: 1
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: 25
  • Position: #220 / 249
  • Number of attempts: 1
Reformat most common surnames - 644 entries

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

  • Best score: 23
  • Best player score: 65
  • Position: #187 / 197
  • Number of attempts: 1
Change the content of a string - 1457 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Position: #428 / 552
  • Number of attempts: 1
Add fold markers to a .c file - 550 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

  • Best score: 30
  • Best player score: 49
  • Position: #151 / 170
  • Number of attempts: 1
Simple text editing with Vim - 12232 entries

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

  • Best score: 13
  • Best player score: 19
  • Position: #2592 / 3567
  • Number of attempts: 7
Reformat/Refactor a Golfer Class - 6511 entries

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

  • Best score: 32
  • Best player score: 39
  • Position: #672 / 1602
  • Number of attempts: 1
Arto Vuori
Twitter:

Founder & CTO of @Usetrace - the cleverest functional testing tool for webapps.

entered into 52 challenges

contributed 0 challenges