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

Wrap the text of an email message to 79 characters - 679 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #153 / 386
  • Number of attempts: 1
Search and Replace 0 - 4791 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #186 / 1585
  • Number of attempts: 5
Swap assigned value - 624 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #122 / 249
  • Number of attempts: 1
Change your calendar - 362 entries

Happy New Year!

  • Best score: 18
  • Best player score: 33
  • Position: #43 / 85
  • Number of attempts: 2
fib.c cleanup - 66 entries

cleanup the file

  • Best score: 15
  • Best player score: 16
  • Position: #21 / 54
  • Number of attempts: 1
REDRUM - 150 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: 17
  • Position: #35 / 62
  • Number of attempts: 2
Enumerate words - 250 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 26
  • Position: #42 / 89
  • Number of attempts: 2
Harder than "abcd > a b c d" - 77 entries

Not as easy as the last challenge. This time, just one space between a and b, up to 25 spaces between y and z. (Removed some lines; diff was too long.)

  • Best score: 15
  • Best player score: 26
  • Position: #33 / 40
  • Number of attempts: 1
Transposition - 82 entries

Transpose the original lines in separate columns, one for each line.

  • Best score: 31
  • Best player score: 36
  • Position: #5 / 30
  • Number of attempts: 7
Block Fun 1 - 189 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 14
  • Position: #5 / 73
  • Number of attempts: 3
Groups magic - 150 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 13
  • Position: #6 / 90
  • Number of attempts: 3
Prefixes and suffixes - 591 entries

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

  • Best score: 17
  • Best player score: 28
  • Position: #113 / 192
  • Number of attempts: 1
abcd > a b c d - 280 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #54 / 218
  • Number of attempts: 1
Python: Lots of function arguments - 102 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: 14
  • Position: #23 / 46
  • Number of attempts: 3
A simple change - 442 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #74 / 189
  • Number of attempts: 3
lamb had a little Mary - 586 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #28 / 163
  • Number of attempts: 2
Stairs Indenting - 448 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #93 / 193
  • Number of attempts: 1
Unwrap the text of an email message - 185 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: 23
  • Position: #39 / 72
  • Number of attempts: 3
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #21 / 441
  • Number of attempts: 5
Reverse characters in a line - 709 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 13
  • Position: #54 / 249
  • Number of attempts: 1
Reformat most common surnames - 647 entries

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

  • Best score: 23
  • Best player score: 25
  • Position: #53 / 198
  • Number of attempts: 5
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: #73 / 217
  • Number of attempts: 2
Change the content of a string - 1476 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #89 / 558
  • Number of attempts: 3
Sort and add attributes - 1327 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #131 / 529
  • Number of attempts: 2
Add fold markers to a .c file - 556 entries

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

  • Best score: 30
  • Best player score: 36
  • Position: #101 / 172
  • Number of attempts: 2
Reconstruct the Sentence - 1368 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: 20
  • Position: #63 / 384
  • Number of attempts: 2
Simple text editing with Vim - 12290 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2098 / 3581
  • Number of attempts: 1
Reformat/Refactor a Golfer Class - 6558 entries

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

  • Best score: 32
  • Best player score: 33
  • Position: #218 / 1615
  • Number of attempts: 5

Contributed Challenges

XML to JSON - 44 entries

Convert this xml file into json.

Minimalist Limerick - 516 entries

Reproduce this lovely poem.

Alec Goebel
Twitter:

http://pastebin.com/3hWGButx

entered into 28 challenges

contributed 2 challenges