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

Reverse and count - 378 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 33
  • Number of attempts: 1
One number per line - 10523 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Number of attempts: 5
attr_aligner - 2795 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 9
Adam's challenge - 639 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 7
Nesting SASS - 204 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 17
  • Number of attempts: 1
Reformat a C golf submission - 464 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 23
  • Best player score: 25
  • Number of attempts: 5
Words in parens - 10374 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 3
Hatsuyume - 360 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 10
Scrambled numbers - 696 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 7
Space out the alphabet - 1274 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 10
Line Zipper - 388 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 3
Every other line - 1806 entries

AaAaAaA

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 9
Stairstep digits - 202 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Number of attempts: 2
Unwrap the text of an email message - 135 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: 16
  • Number of attempts: 8
I forgot quotes - 10181 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 11
Vertical Limit - 2032 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 21
  • Number of attempts: 9
Paragraph breaks - 381 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 5
comments galore - 870 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 4
Swap values - 3155 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 5
Fiddle percentages into real numbers - 668 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 2
Shebangs for all - 1552 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: 8
That hyphen - 1859 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 8
V to the i - 3564 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 7
switch variable - 4095 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 11
  • Number of attempts: 4
Combines all items - 226 entries

For each line that starts with the same number I want to combine its contents

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
comment and uncomment code inline - 627 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 5
learn vim in short time - 175 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Number of attempts: 1
quotes inside quotes - 2647 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 2
  • Best player score: 14
  • Number of attempts: 4
Order and join - 695 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 6
Collect List - 3164 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 7
Just the middle - 8496 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 5
Overall Vimgolf Rank - 138 entries

Suppose you are trying to figure out what your overall rank is at Vimgolf(the sum of all the ranks you got), and as a Vim ninja you decided to use Vim to do the job. Your solution should work for every Vimgolf profile page(The actual input file for this challenge is my Vimgolf profile page). So, direct answer insertion is considered cheating.

  • Best score: 8
  • Best player score: 9
  • Number of attempts: 2
Align commas - 760 entries

There are 15,000 aligning challenges on vimgolf.com, and they're all exactly the same. I hope this one is a little different.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 7
A HAPPY NEW YEAR 2014 ! - 9081 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 4
Search and Replace 0 - 3841 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 6
-a-b-c- - 2368 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 12
Vice versa - 5386 entries

Little role switching.

  • Best score: 2
  • Best player score: 12
  • Number of attempts: 5
Don't know what this is - 1606 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: 11
  • Number of attempts: 9
Extract argument from function - 1816 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 6
Melvin Cheung
Twitter:

Handsome boy

entered into 39 challenges

contributed 0 challenges