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

Wget failed to download redirections - 178 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

  • Best score: 15
  • Best player score: 30
  • Position: #56 / 60
  • Number of attempts: 1
vim = 22 / 7 - 424 entries

pi square vim

  • Best score: 20
  • Best player score: 39
  • Position: #122 / 130
  • Number of attempts: 1
Interweave two blocks of text - 610 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: 19
  • Position: #162 / 207
  • Number of attempts: 1
Separating firstname & lastname - 113 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 29
  • Position: #39 / 53
  • Number of attempts: 1
Swap assigned value - 561 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 18
  • Position: #231 / 236
  • Number of attempts: 1
Change your calendar - 326 entries

Happy New Year!

  • Best score: 18
  • Best player score: 29
  • Position: #36 / 80
  • Number of attempts: 1
Land of the Lost - 76 entries

Enter the tabs below the lyrics

  • Best score: 26
  • Best player score: 38
  • Position: #14 / 29
  • Number of attempts: 2
Interleave lines - 134 entries

This is some kind of « paste -d'\n' c b a ». There are many ways to achieve this.. just find the shortest!

  • Best score: 17
  • Best player score: 33
  • Position: #34 / 55
  • Number of attempts: 1
Remove hard line breaks - 61 entries

Text files with Hard breaks are not good for e-readers. We need remove all hard line breaks and have long lines.

  • Best score: 10
  • Best player score: 17
  • Position: #20 / 29
  • Number of attempts: 1
Greek column realign - 42 entries

Oops one letter is missing! Shift down the second column to insert nu letter. Symbol can be entered using: <C-K>n*

  • Best score: 21
  • Best player score: 32
  • Position: #20 / 23
  • Number of attempts: 3
Refactoring useless Method away - 91 entries

Real-life challenge, convert a bunch of ifs to a switch statement

  • Best score: 47
  • Best player score: 60
  • Position: #17 / 32
  • Number of attempts: 1
Test everything! - 152 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

  • Best score: 22
  • Best player score: 37
  • Position: #37 / 49
  • Number of attempts: 3
Pretty format for variable declarations - 144 entries

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

  • Best score: 14
  • Best player score: 23
  • Position: #51 / 55
  • Number of attempts: 1
Shift down - 191 entries

Number words are back.

  • Best score: 19
  • Best player score: 33
  • Position: #60 / 66
  • Number of attempts: 1
120 Degrees - 454 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 40
  • Position: #137 / 141
  • Number of attempts: 1
NBCU Weekly Challenge - #0 - 124 entries

One of our favorites lines here at NBCU! p.s. The first version of #0 was deleted due to me copy/pasting a HTML entity. Congrats to the one who figured that out, you are a true ninja warrior!

  • Best score: 30
  • Best player score: 34
  • Position: #40 / 55
  • Number of attempts: 2
Refactor static member invocation - 193 entries

Someone used a static method. Refactor the method into a static import while fixing the assertion.

  • Best score: 28
  • Best player score: 35
  • Position: #37 / 62
  • Number of attempts: 2
Comparing scores - 94 entries

If Alice and Bob both did the challenge, put their entries together in the top paragraph, so we can compare their scores more easily.

  • Best score: 18
  • Best player score: 34
  • Position: #23 / 33
  • Number of attempts: 1
Neither Fizz nor Buzz - 221 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Position: #73 / 97
  • Number of attempts: 1
Shuffle puzzle - 307 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 16
  • Position: #79 / 100
  • Number of attempts: 1
Going underground.... - 315 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

  • Best score: 22
  • Best player score: 30
  • Position: #72 / 122
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 338 entries

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

  • Best score: 15
  • Best player score: 19
  • Position: #83 / 102
  • Number of attempts: 2
Pairs of numbers - 346 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: 64
  • Position: #124 / 130
  • Number of attempts: 1
Assign list - 166 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 59
  • Position: #51 / 58
  • Number of attempts: 1
Word frequency alignment - 248 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 6
  • Position: #135 / 147
  • Number of attempts: 1
Minimalist Limerick - 507 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 35
  • Position: #78 / 168
  • Number of attempts: 1
REDRUM - 145 entries

If you remember "The Shinning", the first time you saw the bloody word REDRUM you probably thinked "What the Hell is that?" Well, then you know that you need a little help from a looking-glass to make sense of it. Now it's time to use vim like a mirror to reveal the message.

  • Best score: 14
  • Best player score: 28
  • Position: #52 / 59
  • Number of attempts: 1
Enumerate words - 235 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 27
  • Position: #65 / 85
  • Number of attempts: 1
Block Fun 1 - 179 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 25
  • Position: #58 / 69
  • Number of attempts: 1
Prefixes and suffixes - 567 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #106 / 185
  • Number of attempts: 2
Refactor arguments into object argument - 160 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 68
  • Position: #35 / 64
  • Number of attempts: 1
abcd > a b c d - 267 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #154 / 208
  • Number of attempts: 2
Readable Rubyhash - 239 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: 30
  • Position: #68 / 88
  • Number of attempts: 2
NATO phonetic alphabet - 490 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 24
  • Position: #151 / 185
  • Number of attempts: 1
A simple change - 410 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #106 / 180
  • Number of attempts: 1
Tiny column alignment - 39 entries

Align using the four blocks, don't forget to lowercase and have fun!

  • Best score: 33
  • Best player score: 52
  • Position: #13 / 18
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1522 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 15
  • Position: #396 / 428
  • Number of attempts: 1
Stairs Indenting - 434 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 15
  • Position: #146 / 186
  • Number of attempts: 4
Cleanining up 80 column concatenated text - 185 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

  • Best score: 31
  • Best player score: 50
  • Position: #60 / 74
  • Number of attempts: 1
Let's play some Ivmgolf - 1022 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #269 / 422
  • Number of attempts: 1
you're stuck on jQuery < 1.7 - 332 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

  • Best score: 25
  • Best player score: 33
  • Position: #83 / 108
  • Number of attempts: 1
Inconsistent real estate paste - 176 entries

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

  • Best score: 24
  • Best player score: 59
  • Position: #47 / 53
  • Number of attempts: 1
Exchanging Quotes - 800 entries

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

  • Best score: 30
  • Best player score: 45
  • Position: #203 / 220
  • Number of attempts: 1
Append semicolon after expressions - 968 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 14
  • Position: #359 / 391
  • Number of attempts: 1
Reverse and double space - 456 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 16
  • Position: #101 / 187
  • Number of attempts: 1
Remove noise from HTTP log - 666 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: 16
  • Position: #180 / 263
  • Number of attempts: 2
Ugly spreadsheet copy/paste to CSV - 905 entries

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

  • Best score: 19
  • Best player score: 44
  • Position: #125 / 176
  • Number of attempts: 3
Replacing some words - 417 entries

How fast could it be?

  • Best score: 17
  • Best player score: 33
  • Position: #116 / 146
  • Number of attempts: 1
PHP <--> Java class conversion Part 1 - 211 entries

Convert this tiny php class to adequate java one.

  • Best score: 65
  • Best player score: 115
  • Position: #43 / 61
  • Number of attempts: 1
Alphabetize the directory - 269 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 40
  • Position: #79 / 97
  • Number of attempts: 2
Case preserving word replacement - 439 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: 23
  • Position: #149 / 176
  • Number of attempts: 1
imports alignment (python) - 656 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 30
  • Position: #151 / 193
  • Number of attempts: 3
HTML to Haml - 837 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 45
  • Position: #142 / 200
  • Number of attempts: 2
Reformat long lines - 329 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 / 129
  • Number of attempts: 1
Generate English Alphabets - 448 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 26
  • Position: #154 / 196
  • Number of attempts: 1
Insert a Markdown link - 420 entries

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

  • Best score: 22
  • Best player score: 31
  • Position: #124 / 141
  • Number of attempts: 1
Ruby 1.9 hashes - 1177 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: 18
  • Position: #337 / 387
  • Number of attempts: 1
Table Reshuffle - 360 entries

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

  • Best score: 22
  • Best player score: 35
  • Position: #82 / 129
  • Number of attempts: 1
Reverse and count - 420 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: #92 / 161
  • Number of attempts: 2
Ruby 1.9 compat - 598 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: 18
  • Position: #167 / 227
  • Number of attempts: 2
Reverse Simple Deletion - 787 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 16
  • Position: #418 / 437
  • Number of attempts: 1
Increment, increment, increment.... - 599 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #297 / 382
  • Number of attempts: 1
Context insensitive completion 0 - 476 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: 7
  • Best player score: 8
  • Position: #132 / 224
  • Number of attempts: 1
Context Insensitive completion 1 - 437 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #122 / 224
  • Number of attempts: 1
Make Fancy Header - 983 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 18
  • Position: #232 / 331
  • Number of attempts: 1
Reformat most common surnames - 599 entries

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

  • Best score: 23
  • Best player score: 41
  • Position: #152 / 188
  • Number of attempts: 1
Get rid of html tags - 348 entries

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

  • Best score: 15
  • Best player score: 17
  • Position: #101 / 209
  • Number of attempts: 2
Sort and add attributes - 1217 entries

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

  • Best score: 33
  • Best player score: 37
  • Position: #395 / 492
  • Number of attempts: 1
Add fold markers to a .c file - 499 entries

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

  • Best score: 30
  • Best player score: 37
  • Position: #110 / 158
  • Number of attempts: 1
Flodder-challenge - 928 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 37
  • Position: #165 / 274
  • Number of attempts: 1
ltn614
Twitter:

entered into 70 challenges

contributed 0 challenges