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 - 4743 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #802 / 1878
  • Number of attempts: 1
Search and Replace 0 - 4790 entries

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

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

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1553 / 4160
  • Number of attempts: 4
Basic renumbering - 5584 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 24
  • Position: #1074 / 1257
  • Number of attempts: 1
Restore order to the alphabet - 188 entries

The numbers are OK. The letters are wonky.

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

Add backslashes.

  • Best score: 7
  • Best player score: 13
  • Position: #172 / 266
  • Number of attempts: 1
Swap assigned value - 614 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 20
  • Position: #242 / 247
  • Number of attempts: 2
Line 'em up! - 392 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: #92 / 110
  • Number of attempts: 2
Mute the second method of this script - 447 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 11
  • Position: #222 / 237
  • Number of attempts: 2
Winning streak - 124 entries

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

  • Best score: 21
  • Best player score: 40
  • Position: #43 / 49
  • 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: 40
  • Position: #42 / 52
  • Number of attempts: 2
increment by column in XML - 146 entries

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

  • Best score: 19
  • Best player score: 29
  • Position: #47 / 53
  • Number of attempts: 2
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: 28
  • Position: #61 / 62
  • Number of attempts: 2
I forgot quotes - 15923 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2039 / 4159
  • Number of attempts: 1
Subtraction - 178 entries

Solve the equations.

  • Best score: 18
  • Best player score: 31
  • Position: #51 / 61
  • Number of attempts: 1
Count both ways - 997 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #151 / 350
  • Number of attempts: 1
Don't know what this is - 1978 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: #286 / 578
  • Number of attempts: 1
Where should I put the Newline? - 859 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #231 / 430
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10616 entries

A HAPPY NEW YEAR 2014 !

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

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1995 / 3944
  • Number of attempts: 3
Word frequency alignment - 273 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 / 156
  • Number of attempts: 1
Minimalist Limerick - 516 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 36
  • Position: #86 / 171
  • Number of attempts: 2
Enumerate words - 248 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 26
  • Position: #37 / 88
  • Number of attempts: 4
Circle in a square - 140 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: #37 / 52
  • Number of attempts: 1
Block Fun 1 - 188 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 19
  • Position: #23 / 72
  • Number of attempts: 5
Prefixes and suffixes - 591 entries

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

  • Best score: 17
  • Best player score: 27
  • Position: #101 / 192
  • Number of attempts: 2
abcd > a b c d - 279 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 17
  • Position: #203 / 217
  • Number of attempts: 3
Python: Lots of function arguments - 101 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: #26 / 45
  • Number of attempts: 1
Readable Rubyhash - 243 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 / 91
  • Number of attempts: 1
Checkerboard case pattern - 144 entries

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

  • Best score: 15
  • Best player score: 17
  • Position: #22 / 57
  • Number of attempts: 3
Shuffle and Sort - 208 entries

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

  • Best score: 17
  • Best player score: 29
  • Position: #57 / 65
  • Number of attempts: 2
The name of the game - 646 entries

End up with the name of the game.

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

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

  • Best score: 16
  • Best player score: 36
  • Position: #91 / 161
  • Number of attempts: 1
Stairs Indenting - 446 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #86 / 193
  • Number of attempts: 1
Unwrap the text of an email message - 184 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: #54 / 72
  • Number of attempts: 1
Saving the hashes(#) - 1992 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: #407 / 473
  • Number of attempts: 3
Create an alphabet diamond - 79 entries

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

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

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 10
  • Position: #336 / 440
  • Number of attempts: 2
switch variable - 5028 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #782 / 1734
  • Number of attempts: 3
Shebangs for all - 1904 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: #214 / 497
  • Number of attempts: 2
Reformat most common surnames - 644 entries

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

  • Best score: 23
  • Best player score: 29
  • Position: #103 / 197
  • Number of attempts: 3
Remember FizzBuzz? - 653 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 71
  • Position: #139 / 177
  • 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: #75 / 217
  • Number of attempts: 1
Change the content of a string - 1457 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Position: #342 / 552
  • Number of attempts: 3
Sort and add attributes - 1321 entries

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

  • Best score: 33
  • Best player score: 37
  • Position: #417 / 527
  • Number of attempts: 3
Reconstruct the Sentence - 1348 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: #188 / 379
  • Number of attempts: 2
Braces or Brackets? - 870 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: #166 / 284
  • Number of attempts: 2
Flodder-challenge - 1089 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 33
  • Position: #100 / 306
  • Number of attempts: 3
Simple text editing with Vim - 12233 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #977 / 3567
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6512 entries

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

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

entered into 50 challenges

contributed 0 challenges