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

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

  • Best score: 7
  • Best player score: 7
  • Position: #190 / 1899
  • Number of attempts: 3
Just the middle - 11500 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #212 / 4216
  • Number of attempts: 5
Basic renumbering - 5685 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Position: #869 / 1270
  • Number of attempts: 2
comments galore - 1069 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #83 / 428
  • Number of attempts: 2
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 12
  • Position: #138 / 269
  • Number of attempts: 3
Swap assigned value - 664 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #171 / 258
  • Number of attempts: 1
Collect List - 4308 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 18
  • Position: #1018 / 1192
  • Number of attempts: 2
Rail fence transposition cipher - 84 entries

Solve a rail fence transposition cipher using vim. This ciphertext was created using two rails. Use vim to transpose the text and recover the original quote.

  • Best score: 14
  • Best player score: 17
  • Position: #14 / 26
  • Number of attempts: 2
Space out the alphabet - 1659 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Position: #23 / 446
  • Number of attempts: 9
Fix the XML - 1039 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 29
  • Position: #231 / 290
  • Number of attempts: 2
Shuffled numbers - 246 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

  • Best score: 15
  • Best player score: 15
  • Position: #5 / 96
  • Number of attempts: 3
I forgot quotes - 16051 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #145 / 4194
  • Number of attempts: 6
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #87 / 1138
  • Number of attempts: 4
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #225 / 354
  • Number of attempts: 1
120 Degrees - 505 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 14
  • Position: #19 / 146
  • Number of attempts: 4
Where should I put the Newline? - 883 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #143 / 438
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10699 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #685 / 3695
  • Number of attempts: 3
attr_aligner - 3525 entries

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

  • Best score: 19
  • Best player score: 19
  • Position: #93 / 706
  • Number of attempts: 9
Letter case trickery - 1644 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 13
  • Position: #402 / 520
  • Number of attempts: 1
quotes inside quotes - 3182 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: 14
  • Best player score: 14
  • Position: #191 / 1085
  • Number of attempts: 6
Words in parens - 12969 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2653 / 3970
  • Number of attempts: 1
Hole-in-one - 1024 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 16
  • Position: #74 / 305
  • Number of attempts: 4
Groups magic - 162 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: #14 / 95
  • Number of attempts: 3
SFD-ROC: vimvimvim - 1616 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 8
  • Position: #68 / 447
  • Number of attempts: 6
Switch function arguments - 2152 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #111 / 667
  • Number of attempts: 4
Remove noise from HTTP log - 724 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 16
  • Position: #183 / 275
  • Number of attempts: 1
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #354 / 1750
  • Number of attempts: 4
Sort the cardinal numbers - 315 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 12
  • Position: #40 / 149
  • Number of attempts: 2
Make it more readable - 2009 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 13
  • Position: #68 / 652
  • Number of attempts: 4
remove dupes from array - 1358 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 22
  • Position: #179 / 336
  • Number of attempts: 2
Numbering a List - 1939 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 17
  • Position: #109 / 655
  • Number of attempts: 6
Shebangs for all - 2046 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: 11
  • Position: #32 / 522
  • Number of attempts: 6
Reverse and count - 486 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: 29
  • Position: #120 / 179
  • Number of attempts: 1
Reverse Simple Deletion - 857 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 11
  • Position: #29 / 461
  • Number of attempts: 3
The Cake is a Lie - 1374 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #205 / 534
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3793 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 34
  • Position: #675 / 814
  • Number of attempts: 1
Simple text editing with Vim - 13095 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #341 / 3767
  • Number of attempts: 4
Raj
Twitter:

Jester, Coder, Motorcyclist, Student Tabla-ist

entered into 37 challenges

contributed 0 challenges