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

V to the i - 4639 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 8
  • Position: #789 / 1856
  • Number of attempts: 1
Search and Replace 0 - 4651 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #176 / 1541
  • Number of attempts: 4
Just the middle - 11136 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1529 / 4112
  • Number of attempts: 4
Basic renumbering - 5428 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 24
  • Position: #1045 / 1226
  • Number of attempts: 1
Restore order to the alphabet - 175 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 35
  • Position: #60 / 64
  • Number of attempts: 1
Mirror Symmetry - 781 entries

Add backslashes.

  • Best score: 7
  • Best player score: 13
  • Position: #168 / 262
  • Number of attempts: 1
Swap assigned value - 556 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 20
  • Position: #231 / 235
  • Number of attempts: 2
Line 'em up! - 367 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 31
  • Position: #87 / 105
  • Number of attempts: 2
Mute the second method of this script - 439 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 11
  • Position: #219 / 233
  • Number of attempts: 2
Winning streak - 113 entries

Make the number on each line equal the consecutive L's or W's.

  • Best score: 21
  • Best player score: 40
  • Position: #42 / 48
  • Number of attempts: 1
Test everything! - 136 entries

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

  • Best score: 22
  • Best player score: 40
  • Position: #37 / 47
  • Number of attempts: 2
increment by column in XML - 144 entries

modify an arbitrary "column" in an xml table by incrementing a an arbitrary placeholder string

  • Best score: 19
  • Best player score: 29
  • Position: #46 / 52
  • Number of attempts: 2
Pretty format for variable declarations - 137 entries

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

  • Best score: 14
  • Best player score: 28
  • Position: #53 / 54
  • Number of attempts: 2
I forgot quotes - 15727 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2012 / 4113
  • Number of attempts: 1
Subtraction - 168 entries

Solve the equations.

  • Best score: 18
  • Best player score: 31
  • Position: #49 / 58
  • Number of attempts: 1
Count both ways - 957 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #145 / 340
  • Number of attempts: 1
Don't know what this is - 1948 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 14
  • Position: #281 / 571
  • Number of attempts: 1
Where should I put the Newline? - 842 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #227 / 421
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10533 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #316 / 3637
  • Number of attempts: 5
Words in parens - 12736 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1977 / 3919
  • Number of attempts: 3
Word frequency alignment - 241 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: 5
  • Position: #16 / 145
  • Number of attempts: 1
Minimalist Limerick - 503 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 36
  • Position: #84 / 167
  • Number of attempts: 2
Enumerate words - 232 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 26
  • Position: #34 / 84
  • Number of attempts: 4
Circle in a square - 125 entries

Probably looks more like "Egg in a rectangle" in most fonts, but it's actually 23x23.

  • Best score: 23
  • Best player score: 55
  • Position: #33 / 48
  • Number of attempts: 1
Block Fun 1 - 179 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 19
  • Position: #22 / 69
  • Number of attempts: 5
Prefixes and suffixes - 567 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #98 / 185
  • Number of attempts: 2
abcd > a b c d - 260 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 17
  • Position: #193 / 204
  • Number of attempts: 3
Python: Lots of function arguments - 81 entries

The function definition is too long for one line. The modeline helps you with some typical Python indent settings.

  • Best score: 13
  • Best player score: 15
  • Position: #24 / 40
  • Number of attempts: 1
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: 29
  • Position: #57 / 88
  • Number of attempts: 1
Checkerboard case pattern - 130 entries

All the squares are white. Make some of them black. But only the right ones.

  • Best score: 15
  • Best player score: 17
  • Position: #20 / 53
  • Number of attempts: 3
Shuffle and Sort - 183 entries

The values where sorted incorrectly. Get them back to how they are supposed to be

  • Best score: 17
  • Best player score: 29
  • Position: #53 / 60
  • Number of attempts: 2
The name of the game - 627 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #66 / 343
  • Number of attempts: 1
lamb had a little Mary - 559 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 36
  • Position: #89 / 157
  • Number of attempts: 1
Stairs Indenting - 424 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #84 / 183
  • Number of attempts: 1
Unwrap the text of an email message - 172 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 25
  • Position: #51 / 68
  • Number of attempts: 1
Saving the hashes(#) - 1961 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 32
  • Position: #403 / 466
  • Number of attempts: 3
Create an alphabet diamond - 76 entries

Here's a brain teaser to keep things interesting...

  • Best score: 40
  • Best player score: 88
  • Position: #23 / 29
  • Number of attempts: 1
Let's play some Ivmgolf - 1004 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 10
  • Position: #320 / 417
  • Number of attempts: 2
switch variable - 4917 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #768 / 1701
  • Number of attempts: 3
Shebangs for all - 1771 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 14
  • Position: #203 / 467
  • Number of attempts: 2
Reformat most common surnames - 586 entries

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

  • Best score: 23
  • Best player score: 29
  • Position: #96 / 186
  • Number of attempts: 3
Remember FizzBuzz? - 587 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 71
  • Position: #130 / 166
  • Number of attempts: 1
Get rid of html tags - 341 entries

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

  • Best score: 15
  • Best player score: 17
  • Position: #71 / 207
  • Number of attempts: 1
Change the content of a string - 1346 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Position: #317 / 520
  • Number of attempts: 3
Sort and add attributes - 1183 entries

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

  • Best score: 33
  • Best player score: 37
  • Position: #380 / 482
  • Number of attempts: 3
Reconstruct the Sentence - 1141 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 20
  • Best player score: 21
  • Position: #169 / 346
  • Number of attempts: 2
Braces or Brackets? - 700 entries

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

  • Best score: 34
  • Best player score: 47
  • Position: #147 / 251
  • Number of attempts: 2
Flodder-challenge - 901 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 33
  • Position: #86 / 270
  • Number of attempts: 3
Simple text editing with Vim - 11620 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #946 / 3409
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 5993 entries

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

  • Best score: 32
  • Best player score: 37
  • Position: #490 / 1478
  • Number of attempts: 7
Lieven Keersmaekers
Twitter:

entered into 50 challenges

contributed 0 challenges