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

abcd > a b c d - 241 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 5570 entries

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

  • Best score: 32
  • Best player score: 37
  • Number of attempts: 7
Checkerboard case pattern - 106 entries

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

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 3
Swap assigned value - 500 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 20
  • Number of attempts: 2
Python: Lots of function arguments - 73 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
  • 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: 28
  • Number of attempts: 2
Enumerate words - 223 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 26
  • Number of attempts: 4
Restore order to the alphabet - 153 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 35
  • Number of attempts: 1
Simple text editing with Vim - 10703 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 4
Count both ways - 899 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 1
Where should I put the Newline? - 809 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Remember FizzBuzz? - 537 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 71
  • 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
Stairs Indenting - 360 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 1
Words in parens - 11443 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 3
Reformat most common surnames - 523 entries

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

  • Best score: 23
  • Best player score: 29
  • Number of attempts: 3
Shebangs for all - 1643 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
  • Number of attempts: 2
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: 40
  • 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: 1
Braces or Brackets? - 635 entries

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

  • Best score: 34
  • Best player score: 47
  • Number of attempts: 2
Just the middle - 9762 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 4
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: 5
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 9782 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 5
Search and Replace 0 - 4226 entries

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

  • Best score: 12
  • Best player score: 12
  • 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
  • Number of attempts: 1
Unwrap the text of an email message - 150 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
  • Number of attempts: 1
Let's play some Ivmgolf - 945 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 10
  • Number of attempts: 2
The name of the game - 588 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Create an alphabet diamond - 74 entries

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

  • Best score: 40
  • Best player score: 88
  • Number of attempts: 1
Mute the second method of this script - 417 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 11
  • Number of attempts: 2
V to the i - 4150 entries

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

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Block Fun 1 - 158 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 19
  • Number of attempts: 5
switch variable - 4451 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 3
Reconstruct the Sentence - 1030 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
  • Number of attempts: 2
Basic renumbering - 4854 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 24
  • Number of attempts: 1
increment by column in XML - 140 entries

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

  • Best score: 19
  • Best player score: 29
  • Number of attempts: 2
lamb had a little Mary - 507 entries

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

  • Best score: 16
  • Best player score: 36
  • Number of attempts: 1
Mirror Symmetry - 727 entries

Add backslashes.

  • Best score: 7
  • Best player score: 13
  • Number of attempts: 1
Change the content of a string - 1257 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 25
  • Number of attempts: 3
Shuffle and Sort - 171 entries

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

  • Best score: 17
  • Best player score: 29
  • Number of attempts: 2
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: 29
  • Number of attempts: 1
Subtraction - 147 entries

Solve the equations.

  • Best score: 18
  • Best player score: 31
  • Number of attempts: 1
Winning streak - 105 entries

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

  • Best score: 21
  • Best player score: 40
  • Number of attempts: 1
Line 'em up! - 276 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
  • Number of attempts: 2
Don't know what this is - 1809 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
  • Number of attempts: 1
Saving the hashes(#) - 1806 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
  • Number of attempts: 3
Flodder-challenge - 814 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 33
  • Number of attempts: 3
I forgot quotes - 12863 entries

Oops.

  • Best score: 10
  • Best player score: 15
  • Number of attempts: 1
Minimalist Limerick - 488 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 36
  • Number of attempts: 2
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: 3
Lieven Keersmaekers
Twitter:

entered into 50 challenges

contributed 0 challenges