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

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

  • Best score: 7
  • Best player score: 8
  • Position: #933 / 1914
  • Number of attempts: 2
Search and Replace 0 - 5159 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #222 / 1674
  • Number of attempts: 5
Basic renumbering - 5733 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 19
  • Position: #731 / 1279
  • Number of attempts: 2
Swap assigned value - 694 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 13
  • Position: #227 / 263
  • Number of attempts: 2
Test everything! - 213 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

  • Best score: 21
  • Best player score: 26
  • Position: #22 / 58
  • Number of attempts: 4
Condensed Cases - 827 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 15
  • Position: #156 / 254
  • Number of attempts: 2
Pretty format for variable declarations - 186 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #29 / 68
  • Number of attempts: 3
I forgot quotes - 16237 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Position: #2418 / 4224
  • Number of attempts: 3
vim1001 - 327 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

  • Best score: 17
  • Best player score: 23
  • Position: #63 / 112
  • Number of attempts: 2
-a-b-c- - 3241 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #502 / 1146
  • Number of attempts: 1
Gray area - 763 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 14
  • Position: #202 / 276
  • Number of attempts: 3
Do you demand a shrubbery? - 1207 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 18
  • Position: #136 / 309
  • Number of attempts: 2
Shuffle puzzle - 377 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 14
  • Position: #42 / 108
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10755 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #508 / 3715
  • Number of attempts: 9
quotes inside quotes - 3202 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: 16
  • Position: #530 / 1093
  • Number of attempts: 2
Sort the VimGolf challenges by popularity - 369 entries

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

  • Best score: 15
  • Best player score: 17
  • Position: #70 / 110
  • Number of attempts: 1
Words in parens - 13053 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 17
  • Position: #2558 / 3991
  • Number of attempts: 2
Minimalist Limerick - 539 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 38
  • Position: #111 / 177
  • Number of attempts: 1
abcd > a b c d - 308 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #145 / 231
  • Number of attempts: 1
Dehamlizing - 193 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 38
  • Position: #27 / 73
  • Number of attempts: 2
NATO phonetic alphabet - 547 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 20
  • Position: #55 / 199
  • Number of attempts: 3
The Quick Brown Fox Jumps Over The Lazy Vim - 456 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 10
  • Position: #79 / 199
  • Number of attempts: 2
The name of the game - 696 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #119 / 369
  • Number of attempts: 2
lamb had a little Mary - 659 entries

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

  • Best score: 16
  • Best player score: 40
  • Position: #141 / 179
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1642 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: #62 / 457
  • Number of attempts: 4
Saving the hashes(#) - 2116 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: 31
  • Position: #410 / 488
  • Number of attempts: 1
Let's play some Ivmgolf - 1162 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #274 / 459
  • Number of attempts: 1
Vertical Limit - 2637 entries

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

  • Best score: 21
  • Best player score: 28
  • Position: #602 / 778
  • Number of attempts: 2
Remove noise from HTTP log - 758 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: 17
  • Position: #220 / 281
  • Number of attempts: 2
switch variable - 5128 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1095 / 1764
  • Number of attempts: 2
Line Zipper - 480 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 14
  • Position: #85 / 217
  • Number of attempts: 2
PHP Array Syntax -> MailChimp Merge Syntax - 569 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

  • Best score: 23
  • Best player score: 27
  • Position: #66 / 152
  • Number of attempts: 3
The holy-grail may help - 405 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 17
  • Position: #188 / 221
  • Number of attempts: 2
Ruby 1.9 hashes - 1312 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: 12
  • Best player score: 14
  • Position: #227 / 419
  • Number of attempts: 4
Shebangs for all - 2101 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: 18
  • Position: #378 / 532
  • Number of attempts: 2
Ruby 1.9 compat - 661 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 16
  • Position: #145 / 241
  • Number of attempts: 3
Hatsuyume - 582 entries

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

  • Best score: 15
  • Best player score: 25
  • Position: #91 / 194
  • Number of attempts: 2
The Cake is a Lie - 1416 entries

Correct the capitalization of each word

  • Best score: 8
  • Best player score: 9
  • Position: #196 / 542
  • Number of attempts: 1
Context insensitive completion 0 - 605 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 9
  • Position: #211 / 255
  • Number of attempts: 1
Simple text editing with Vim - 13626 entries

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

  • Best score: 13
  • Best player score: 21
  • Position: #3006 / 3902
  • Number of attempts: 1
Matt Robbins
Twitter:

Lover of unfashionable music and fashionable programming languages...former BBC Frameworker and a very happy Dad!

entered into 40 challenges

contributed 0 challenges