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

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

  • Best score: 7
  • Best player score: 8
  • Position: #792 / 1863
  • Number of attempts: 1
Search and Replace 0 - 4743 entries

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

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

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1546 / 4140
  • Number of attempts: 4
Basic renumbering - 5486 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 24
  • Position: #1060 / 1243
  • Number of attempts: 1
Restore order to the alphabet - 183 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 35
  • Position: #62 / 66
  • Number of attempts: 1
Mirror Symmetry - 787 entries

Add backslashes.

  • Best score: 7
  • Best player score: 13
  • Position: #170 / 264
  • Number of attempts: 1
Swap assigned value - 577 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 20
  • Position: #235 / 239
  • Number of attempts: 2
Line 'em up! - 384 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: #89 / 107
  • Number of attempts: 2
Mute the second method of this script - 444 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 11
  • Position: #222 / 236
  • 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! - 152 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: #39 / 49
  • 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 - 147 entries

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

  • Best score: 13
  • Best player score: 28
  • Position: #56 / 57
  • Number of attempts: 2
I forgot quotes - 15840 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Position: #2024 / 4133
  • Number of attempts: 1
Subtraction - 177 entries

Solve the equations.

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

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #149 / 347
  • Number of attempts: 1
Don't know what this is - 1959 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: #284 / 574
  • Number of attempts: 1
Where should I put the Newline? - 852 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #229 / 426
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10564 entries

A HAPPY NEW YEAR 2014 !

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

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1985 / 3930
  • Number of attempts: 3
Word frequency alignment - 258 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 / 151
  • Number of attempts: 1
Minimalist Limerick - 510 entries

Reproduce this lovely poem.

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

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 26
  • Position: #36 / 86
  • Number of attempts: 4
Circle in a square - 136 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: #36 / 51
  • Number of attempts: 1
Block Fun 1 - 187 entries

Manipulate the columns to produce desired result.

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

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

  • Best score: 17
  • Best player score: 27
  • Position: #100 / 187
  • Number of attempts: 2
abcd > a b c d - 274 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 17
  • Position: #200 / 213
  • Number of attempts: 3
Python: Lots of function arguments - 98 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 / 44
  • Number of attempts: 1
Readable Rubyhash - 242 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 / 90
  • Number of attempts: 1
Checkerboard case pattern - 139 entries

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

  • Best score: 15
  • Best player score: 17
  • Position: #21 / 56
  • Number of attempts: 3
Shuffle and Sort - 201 entries

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

  • Best score: 17
  • Best player score: 29
  • Position: #56 / 63
  • Number of attempts: 2
The name of the game - 638 entries

End up with the name of the game.

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

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

  • Best score: 16
  • Best player score: 36
  • Position: #90 / 159
  • Number of attempts: 1
Stairs Indenting - 440 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #85 / 189
  • Number of attempts: 1
Unwrap the text of an email message - 180 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: #53 / 71
  • Number of attempts: 1
Saving the hashes(#) - 1973 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: #405 / 468
  • 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 - 1050 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 10
  • Position: #330 / 429
  • Number of attempts: 2
switch variable - 4996 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #777 / 1723
  • Number of attempts: 3
Shebangs for all - 1804 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: #207 / 475
  • Number of attempts: 2
Reformat most common surnames - 609 entries

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

  • Best score: 23
  • Best player score: 29
  • Position: #100 / 190
  • Number of attempts: 3
Remember FizzBuzz? - 633 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 71
  • Position: #135 / 172
  • Number of attempts: 1
Get rid of html tags - 356 entries

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

  • Best score: 15
  • Best player score: 17
  • Position: #74 / 213
  • Number of attempts: 1
Change the content of a string - 1409 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Position: #333 / 536
  • Number of attempts: 3
Sort and add attributes - 1245 entries

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

  • Best score: 33
  • Best player score: 37
  • Position: #397 / 503
  • Number of attempts: 3
Reconstruct the Sentence - 1203 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: #175 / 355
  • Number of attempts: 2
Braces or Brackets? - 756 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: #154 / 263
  • Number of attempts: 2
Flodder-challenge - 985 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 33
  • Position: #93 / 287
  • Number of attempts: 3
Simple text editing with Vim - 11865 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #961 / 3472
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6225 entries

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

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

entered into 50 challenges

contributed 0 challenges