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

PHP <--> Java class conversion Part 1 - 178 entries

Convert this tiny php class to adequate java one.

  • Best score: 65
  • Best player score: 115
  • Number of attempts: 1
Pairs of numbers - 325 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
  • Number of attempts: 1
Refactoring useless Method away - 78 entries

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

  • Best score: 47
  • Best player score: 60
  • Number of attempts: 1
Inconsistent real estate paste - 142 entries

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

  • Best score: 24
  • Best player score: 59
  • Number of attempts: 1
Cleanining up 80 column concatenated text - 184 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
  • Number of attempts: 1
HTML to Haml - 738 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 45
  • Number of attempts: 2
Ugly spreadsheet copy/paste to CSV - 732 entries

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

  • Best score: 19
  • Best player score: 44
  • Number of attempts: 3
Tiny column alignment - 37 entries

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

  • Best score: 33
  • Best player score: 52
  • Number of attempts: 1
Test everything! - 111 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
  • Number of attempts: 3
Sort and add attributes - 1101 entries

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

  • Best score: 33
  • Best player score: 37
  • Number of attempts: 1
Flodder-challenge - 814 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 37
  • Number of attempts: 1
Minimalist Limerick - 488 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 35
  • Number of attempts: 1
Assign list - 145 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 59
  • Number of attempts: 1
Add fold markers to a .c file - 443 entries

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

  • Best score: 30
  • Best player score: 37
  • Number of attempts: 1
Reverse and double space - 411 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 274 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
  • Number of attempts: 2
Reverse Simple Deletion - 722 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 16
  • Number of attempts: 1
Exchanging Quotes - 769 entries

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

  • Best score: 30
  • Best player score: 45
  • Number of attempts: 1
Reformat most common surnames - 523 entries

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

  • Best score: 23
  • Best player score: 41
  • Number of attempts: 1
Context Insensitive completion 1 - 395 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 1
Context insensitive completion 0 - 445 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
  • Number of attempts: 1
REDRUM - 136 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
  • Number of attempts: 1
NBCU Weekly Challenge - #0 - 121 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
  • Number of attempts: 2
Get rid of html tags - 315 entries

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

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1325 entries

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

  • Best score: 8
  • Best player score: 15
  • Number of attempts: 1
Neither Fizz nor Buzz - 191 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Number of attempts: 1
you're stuck on jQuery < 1.7 - 317 entries

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

  • Best score: 25
  • Best player score: 33
  • Number of attempts: 1
Let's play some Ivmgolf - 946 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 1
Land of the Lost - 60 entries

Enter the tabs below the lyrics

  • Best score: 26
  • Best player score: 38
  • Number of attempts: 2
Insert a Markdown link - 387 entries

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

  • Best score: 22
  • Best player score: 31
  • Number of attempts: 1
Ruby 1.9 hashes - 1087 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
  • Number of attempts: 1
Append semicolon after expressions - 881 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 1
Prefixes and suffixes - 510 entries

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

  • Best score: 17
  • Best player score: 27
  • Number of attempts: 2
120 Degrees - 380 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 40
  • Number of attempts: 1
vim = 22 / 7 - 398 entries

pi square vim

  • Best score: 20
  • Best player score: 39
  • Number of attempts: 1
Ruby 1.9 compat - 558 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
  • Number of attempts: 2
Table Reshuffle - 325 entries

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

  • Best score: 22
  • Best player score: 35
  • Number of attempts: 1
Interweave two blocks of text - 502 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
  • Number of attempts: 1
Word frequency alignment - 204 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
  • Number of attempts: 1
Separating firstname & lastname - 102 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 29
  • Number of attempts: 1
Stairs Indenting - 360 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 4
Readable Rubyhash - 232 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
  • Number of attempts: 2
abcd > a b c d - 241 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 2
Greek column realign - 40 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
  • Number of attempts: 3
Refactor static member invocation - 185 entries

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

  • Best score: 28
  • Best player score: 35
  • Number of attempts: 2
Make Fancy Header - 923 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 18
  • Number of attempts: 1
Remove hard line breaks - 39 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
  • Number of attempts: 1
NATO phonetic alphabet - 407 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 24
  • Number of attempts: 1
Refactor arguments into object argument - 157 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 68
  • Number of attempts: 1
Alphabetize the directory - 260 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 40
  • Number of attempts: 2
Swap assigned value - 500 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 18
  • Number of attempts: 1
Reverse and count - 379 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
  • Number of attempts: 2
imports alignment (python) - 581 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 30
  • Number of attempts: 3
Remove noise from HTTP log - 620 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
  • Number of attempts: 2
Shuffle puzzle - 289 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
  • Number of attempts: 1
Reformat long lines - 316 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
  • Number of attempts: 1
Case preserving word replacement - 392 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
  • Number of attempts: 1
Enumerate words - 223 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 27
  • Number of attempts: 1
A simple change - 362 entries

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

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 1
Pretty format for variable declarations - 128 entries

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

  • Best score: 14
  • Best player score: 23
  • Number of attempts: 1
Comparing scores - 68 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
  • Number of attempts: 1
Block Fun 1 - 158 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 25
  • Number of attempts: 1
Increment, increment, increment.... - 494 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
Generate English Alphabets - 413 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 26
  • Number of attempts: 1
Change your calendar - 263 entries

Happy New Year!

  • Best score: 18
  • Best player score: 29
  • Number of attempts: 1
Going underground.... - 291 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
  • Number of attempts: 1
Replacing some words - 400 entries

How fast could it be?

  • Best score: 17
  • Best player score: 33
  • Number of attempts: 1
Shift down - 184 entries

Number words are back.

  • Best score: 19
  • Best player score: 33
  • Number of attempts: 1
Wget failed to download redirections - 162 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
  • Number of attempts: 1
Interleave lines - 125 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
  • Number of attempts: 1
ltn614
Twitter:

entered into 70 challenges

contributed 0 challenges