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 - 202 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: #61 / 65
  • Number of attempts: 1
vim = 22 / 7 - 475 entries

pi square vim

  • Best score: 20
  • Best player score: 39
  • Position: #127 / 135
  • Number of attempts: 1
Interweave two blocks of text - 659 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: #167 / 214
  • Number of attempts: 1
Separating firstname & lastname - 138 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 29
  • Position: #43 / 57
  • Number of attempts: 1
Swap assigned value - 647 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 18
  • Position: #248 / 254
  • Number of attempts: 1
Change your calendar - 392 entries

Happy New Year!

  • Best score: 18
  • Best player score: 29
  • Position: #40 / 87
  • Number of attempts: 1
Land of the Lost - 81 entries

Enter the tabs below the lyrics

  • Best score: 25
  • Best player score: 38
  • Position: #16 / 32
  • Number of attempts: 2
Interleave lines - 185 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: #39 / 60
  • Number of attempts: 1
Remove hard line breaks - 74 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: #23 / 34
  • Number of attempts: 1
Greek column realign - 51 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: 19
  • Best player score: 32
  • Position: #22 / 25
  • Number of attempts: 3
Refactoring useless Method away - 116 entries

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

  • Best score: 47
  • Best player score: 60
  • Position: #19 / 34
  • Number of attempts: 1
Test everything! - 186 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: #42 / 54
  • Number of attempts: 3
Pretty format for variable declarations - 170 entries

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

  • Best score: 13
  • Best player score: 23
  • Position: #59 / 64
  • Number of attempts: 1
Shift down - 209 entries

Number words are back.

  • Best score: 19
  • Best player score: 33
  • Position: #62 / 69
  • Number of attempts: 1
120 Degrees - 493 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 40
  • Position: #141 / 145
  • Number of attempts: 1
NBCU Weekly Challenge - #0 - 139 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: #43 / 58
  • Number of attempts: 2
Refactor static member invocation - 199 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: #38 / 64
  • Number of attempts: 2
Comparing scores - 112 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: #25 / 35
  • Number of attempts: 1
Neither Fizz nor Buzz - 253 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Position: #77 / 103
  • Number of attempts: 1
Shuffle puzzle - 346 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: #83 / 104
  • Number of attempts: 1
Going underground.... - 356 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: #77 / 128
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 348 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: #86 / 107
  • Number of attempts: 2
Pairs of numbers - 363 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: #129 / 136
  • Number of attempts: 1
Assign list - 192 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 59
  • Position: #53 / 61
  • Number of attempts: 1
Word frequency alignment - 290 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: #148 / 161
  • Number of attempts: 1
Minimalist Limerick - 520 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 35
  • Position: #79 / 174
  • Number of attempts: 1
REDRUM - 166 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: #55 / 65
  • Number of attempts: 1
Enumerate words - 254 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 27
  • Position: #68 / 91
  • Number of attempts: 1
Block Fun 1 - 210 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 25
  • Position: #64 / 75
  • Number of attempts: 1
Prefixes and suffixes - 635 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #111 / 201
  • Number of attempts: 2
Refactor arguments into object argument - 166 entries

A relatively common Javascript refactoring.

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

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #154 / 222
  • Number of attempts: 2
Readable Rubyhash - 267 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: #72 / 95
  • Number of attempts: 2
NATO phonetic alphabet - 529 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 24
  • Position: #157 / 196
  • Number of attempts: 1
A simple change - 461 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #111 / 191
  • Number of attempts: 1
Tiny column alignment - 61 entries

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

  • Best score: 33
  • Best player score: 52
  • Position: #17 / 23
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1606 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: #410 / 446
  • Number of attempts: 1
Stairs Indenting - 473 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 15
  • Position: #152 / 197
  • Number of attempts: 4
Cleanining up 80 column concatenated text - 203 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: #63 / 79
  • Number of attempts: 1
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

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

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

  • Best score: 25
  • Best player score: 33
  • Position: #86 / 113
  • Number of attempts: 1
Inconsistent real estate paste - 216 entries

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

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

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

  • Best score: 30
  • Best player score: 45
  • Position: #211 / 230
  • Number of attempts: 1
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 14
  • Position: #380 / 419
  • Number of attempts: 1
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 16
  • Position: #105 / 199
  • Number of attempts: 1
Remove noise from HTTP log - 717 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: #185 / 273
  • Number of attempts: 2
Ugly spreadsheet copy/paste to CSV - 1009 entries

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

  • Best score: 19
  • Best player score: 44
  • Position: #134 / 193
  • Number of attempts: 3
Replacing some words - 428 entries

How fast could it be?

  • Best score: 17
  • Best player score: 33
  • Position: #119 / 151
  • Number of attempts: 1
PHP <--> Java class conversion Part 1 - 254 entries

Convert this tiny php class to adequate java one.

  • Best score: 65
  • Best player score: 115
  • Position: #45 / 63
  • Number of attempts: 1
Alphabetize the directory - 298 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 40
  • Position: #83 / 101
  • Number of attempts: 2
Case preserving word replacement - 454 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: #153 / 180
  • Number of attempts: 1
imports alignment (python) - 700 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 30
  • Position: #154 / 198
  • Number of attempts: 3
HTML to Haml - 878 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 45
  • Position: #144 / 204
  • Number of attempts: 2
Reformat long lines - 358 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: #119 / 134
  • Number of attempts: 1
Generate English Alphabets - 487 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 26
  • Position: #156 / 206
  • Number of attempts: 1
Insert a Markdown link - 439 entries

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

  • Best score: 22
  • Best player score: 31
  • Position: #129 / 147
  • Number of attempts: 1
Ruby 1.9 hashes - 1244 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: #349 / 406
  • Number of attempts: 1
Table Reshuffle - 429 entries

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

  • Best score: 22
  • Best player score: 35
  • Position: #87 / 139
  • Number of attempts: 1
Reverse and count - 473 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: #101 / 176
  • Number of attempts: 2
Ruby 1.9 compat - 629 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: #174 / 234
  • Number of attempts: 2
Reverse Simple Deletion - 847 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 16
  • Position: #435 / 458
  • Number of attempts: 1
Increment, increment, increment.... - 688 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #316 / 408
  • Number of attempts: 1
Context insensitive completion 0 - 577 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: #148 / 246
  • Number of attempts: 1
Context Insensitive completion 1 - 498 entries

Finish writing this simple Python HTTP server.

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

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 18
  • Position: #239 / 344
  • Number of attempts: 1
Reformat most common surnames - 717 entries

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

  • Best score: 23
  • Best player score: 41
  • Position: #167 / 210
  • Number of attempts: 1
Get rid of html tags - 398 entries

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

  • Best score: 12
  • Best player score: 17
  • Position: #110 / 230
  • Number of attempts: 2
Sort and add attributes - 1451 entries

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

  • Best score: 33
  • Best player score: 37
  • Position: #454 / 563
  • Number of attempts: 1
Add fold markers to a .c file - 625 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: #131 / 183
  • Number of attempts: 1
Flodder-challenge - 1262 entries

Replace the text the most efficient and win!

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

entered into 70 challenges

contributed 0 challenges