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 - 184 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: #59 / 63
  • Number of attempts: 1
vim = 22 / 7 - 447 entries

pi square vim

  • Best score: 20
  • Best player score: 39
  • Position: #123 / 131
  • Number of attempts: 1
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: 19
  • Position: #164 / 211
  • Number of attempts: 1
Separating firstname & lastname - 120 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 29
  • Position: #41 / 55
  • Number of attempts: 1
Swap assigned value - 626 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 18
  • Position: #244 / 250
  • Number of attempts: 1
Change your calendar - 362 entries

Happy New Year!

  • Best score: 18
  • Best player score: 29
  • Position: #38 / 85
  • Number of attempts: 1
Land of the Lost - 77 entries

Enter the tabs below the lyrics

  • Best score: 26
  • Best player score: 38
  • Position: #15 / 30
  • Number of attempts: 2
Interleave lines - 158 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: #37 / 58
  • Number of attempts: 1
Remove hard line breaks - 67 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: #22 / 32
  • Number of attempts: 1
Greek column realign - 48 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: #21 / 24
  • 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! - 162 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: #40 / 52
  • Number of attempts: 3
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: 23
  • Position: #57 / 62
  • Number of attempts: 1
Shift down - 193 entries

Number words are back.

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

Rotate that triangle.

  • Best score: 14
  • Best player score: 40
  • Position: #139 / 143
  • Number of attempts: 1
NBCU Weekly Challenge - #0 - 125 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: #41 / 56
  • Number of attempts: 2
Refactor static member invocation - 198 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 / 63
  • 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 - 230 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Position: #74 / 100
  • Number of attempts: 1
Shuffle puzzle - 317 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: #80 / 101
  • Number of attempts: 1
Going underground.... - 339 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: #74 / 125
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 345 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: #85 / 105
  • Number of attempts: 2
Pairs of numbers - 360 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: #127 / 133
  • Number of attempts: 1
Assign list - 169 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 59
  • Position: #51 / 59
  • Number of attempts: 1
Word frequency alignment - 274 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: #144 / 157
  • Number of attempts: 1
Minimalist Limerick - 516 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 35
  • Position: #78 / 171
  • Number of attempts: 1
REDRUM - 150 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: #53 / 62
  • Number of attempts: 1
Enumerate words - 250 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 27
  • Position: #67 / 89
  • Number of attempts: 1
Block Fun 1 - 189 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 25
  • Position: #62 / 73
  • Number of attempts: 1
Prefixes and suffixes - 593 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #109 / 193
  • Number of attempts: 2
Refactor arguments into object argument - 161 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 68
  • Position: #36 / 65
  • Number of attempts: 1
abcd > a b c d - 280 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #154 / 218
  • Number of attempts: 2
Readable Rubyhash - 244 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: #70 / 92
  • Number of attempts: 2
NATO phonetic alphabet - 501 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 24
  • Position: #154 / 191
  • Number of attempts: 1
A simple change - 442 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #109 / 189
  • Number of attempts: 1
Tiny column alignment - 45 entries

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

  • Best score: 33
  • Best player score: 52
  • Position: #15 / 20
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1581 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: #404 / 439
  • Number of attempts: 1
Stairs Indenting - 448 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 15
  • Position: #149 / 193
  • Number of attempts: 4
Cleanining up 80 column concatenated text - 188 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: #61 / 76
  • Number of attempts: 1
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

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

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

  • Best score: 25
  • Best player score: 33
  • Position: #84 / 111
  • Number of attempts: 1
Inconsistent real estate paste - 184 entries

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

  • Best score: 24
  • Best player score: 59
  • Position: #50 / 55
  • Number of attempts: 1
Exchanging Quotes - 821 entries

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

  • Best score: 30
  • Best player score: 45
  • Position: #206 / 225
  • Number of attempts: 1
Append semicolon after expressions - 1005 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 14
  • Position: #368 / 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: 16
  • Position: #103 / 194
  • Number of attempts: 1
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: 16
  • Position: #182 / 270
  • Number of attempts: 2
Ugly spreadsheet copy/paste to CSV - 973 entries

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

  • Best score: 19
  • Best player score: 44
  • Position: #128 / 185
  • Number of attempts: 3
Replacing some words - 419 entries

How fast could it be?

  • Best score: 17
  • Best player score: 33
  • Position: #117 / 148
  • Number of attempts: 1
PHP <--> Java class conversion Part 1 - 212 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 - 283 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 40
  • Position: #81 / 99
  • 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: 23
  • Position: #152 / 179
  • Number of attempts: 1
imports alignment (python) - 661 entries

Align as one import per line.

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

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 45
  • Position: #142 / 202
  • Number of attempts: 2
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: #116 / 130
  • Number of attempts: 1
Generate English Alphabets - 473 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 26
  • Position: #156 / 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: 31
  • Position: #126 / 143
  • 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: 18
  • Position: #344 / 401
  • 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: 35
  • Position: #84 / 134
  • Number of attempts: 1
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: #99 / 172
  • Number of attempts: 2
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: 18
  • Position: #170 / 230
  • Number of attempts: 2
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

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

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #310 / 401
  • Number of attempts: 1
Context insensitive completion 0 - 507 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: 8
  • Position: #138 / 232
  • Number of attempts: 1
Context Insensitive completion 1 - 460 entries

Finish writing this simple Python HTTP server.

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

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 18
  • Position: #234 / 338
  • Number of attempts: 1
Reformat most common surnames - 647 entries

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

  • Best score: 23
  • Best player score: 41
  • Position: #159 / 198
  • Number of attempts: 1
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: #103 / 217
  • Number of attempts: 2
Sort and add attributes - 1327 entries

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

  • Best score: 33
  • Best player score: 37
  • Position: #425 / 529
  • Number of attempts: 1
Add fold markers to a .c file - 556 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: #122 / 172
  • Number of attempts: 1
Flodder-challenge - 1118 entries

Replace the text the most efficient and win!

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

entered into 70 challenges

contributed 0 challenges