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

Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #1111 / 1585
  • Number of attempts: 2
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: 17
  • Position: #81 / 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: 42
  • Position: #87 / 364
  • Number of attempts: 3
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: 17
  • Position: #5 / 65
  • Number of attempts: 5
Complete the circuit grid! - 84 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: 70
  • Position: #16 / 28
  • Number of attempts: 3
Stairs Indenting - 448 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #66 / 193
  • Number of attempts: 2
Python to Ruby - 196 entries

Convert this Python code to Ruby. NOTE: This program likely won't run.

  • Best score: 24
  • Best player score: 27
  • Position: #21 / 59
  • Number of attempts: 4
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: 24
  • Position: #17 / 56
  • Number of attempts: 3
Vertical Limit - 2437 entries

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

  • Best score: 21
  • Best player score: 25
  • Position: #304 / 736
  • Number of attempts: 5
Make the circuit grid! - 87 entries

Copy this command for a circuit layout program to create 10 total smd commands. Increment the number in quotes to name each pad, and add 0.7 to each of the (X Y) coordinates at the end of each line.

  • Best score: 26
  • Best player score: 26
  • Position: #7 / 48
  • Number of attempts: 2
replacing each line of a block selection - 2946 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #311 / 767
  • Number of attempts: 5
switch variable - 5031 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #81 / 1735
  • Number of attempts: 3
Ugly spreadsheet copy/paste to CSV - 973 entries

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

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

Convert this tiny php class to adequate java one.

  • Best score: 65
  • Best player score: 91
  • Position: #29 / 61
  • Number of attempts: 4
formatted text to markdown - 183 entries

You're converting some posts from an old blog to markdown. The formatted text is far closer to the finished product than the html markup, so it seems like a good place to start. Word wrapping seems to be the main area for optimization.

  • Best score: 70
  • Best player score: 79
  • Position: #37 / 66
  • Number of attempts: 2
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 18
  • Position: #499 / 640
  • Number of attempts: 1
Line Zipper - 450 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 14
  • Position: #66 / 210
  • Number of attempts: 3
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: 33
  • Position: #83 / 148
  • Number of attempts: 6
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: 19
  • Position: #16 / 179
  • Number of attempts: 5
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: #39 / 67
  • Number of attempts: 1
Sort entries based on date - 363 entries

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

  • Best score: 11
  • Best player score: 11
  • Position: #25 / 114
  • Number of attempts: 5
Generate Fibonacci Numbers - 262 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 25
  • Position: #73 / 97
  • Number of attempts: 1
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: 25
  • Position: #90 / 96
  • Number of attempts: 2
HTML to Haml - 842 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 39
  • Position: #101 / 202
  • Number of attempts: 4
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: 16
  • Position: #32 / 130
  • Number of attempts: 7
Generate English Alphabets - 472 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 24
  • Position: #51 / 202
  • Number of attempts: 3
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Position: #219 / 639
  • Number of attempts: 5
Solve the Sokoban - 164 entries

A wink for all Vimgolfers that play Nethack too.

  • Best score: 25
  • Best player score: 32
  • Position: #55 / 72
  • Number of attempts: 3
Java Array2List - 225 entries

Convert an java array initializer into a list.

  • Best score: 67
  • Best player score: 105
  • Position: #46 / 83
  • Number of attempts: 4
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: #10 / 205
  • Number of attempts: 1
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: 17
  • Position: #312 / 401
  • Number of attempts: 5
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: 132
  • Position: #76 / 141
  • Number of attempts: 2
Table Reshuffle - 371 entries

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

  • Best score: 22
  • Best player score: 46
  • Position: #121 / 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: 24
  • Position: #51 / 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: #48 / 73
  • Number of attempts: 2
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #115 / 454
  • Number of attempts: 1
Increment, increment, increment.... - 662 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #120 / 401
  • Number of attempts: 1
The Cake is a Lie - 1286 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #293 / 512
  • Number of attempts: 1
Almost encrypted - 198 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Position: #64 / 144
  • Number of attempts: 1
Make Fancy Header - 1014 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 27
  • Position: #310 / 338
  • Number of attempts: 2
Reformat most common surnames - 647 entries

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

  • Best score: 23
  • Best player score: 33
  • Position: #125 / 198
  • Number of attempts: 1
Remember FizzBuzz? - 654 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 63
  • Position: #117 / 177
  • Number of attempts: 2
Get rid of html tags - 368 entries

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

  • Best score: 15
  • Best player score: 17
  • Position: #37 / 217
  • Number of attempts: 1
Sort and add attributes - 1327 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 33
  • Position: #69 / 529
  • Number of attempts: 4
Braces or Brackets? - 882 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 41
  • Position: #92 / 287
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3330 entries

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

  • Best score: 16
  • Best player score: 19
  • Position: #182 / 735
  • Number of attempts: 9
Simple text editing with Vim - 12276 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #65 / 3578
  • Number of attempts: 7
Reformat/Refactor a Golfer Class - 6555 entries

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

  • Best score: 32
  • Best player score: 37
  • Position: #488 / 1613
  • Number of attempts: 7
Peter Anselmo
Twitter:

I build websites.

entered into 48 challenges

contributed 0 challenges