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

Simple, Practical, and Common - 33616 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 32
  • Position: #5740 / 7420
  • Number of attempts: 1
Search and Replace 0 - 4989 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #1198 / 1624
  • Number of attempts: 2
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2041 / 4197
  • Number of attempts: 8
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Position: #867 / 1264
  • Number of attempts: 1
Angular naming conventions - 320 entries

In angular, a directive name follows the camelCase convention. When the directive is used in an HTML template, the words are instead separated by a dash. Go from to the other the fastest!

  • Best score: 18
  • Best player score: 41
  • Position: #117 / 118
  • Number of attempts: 1
VimGolfNight - 560 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #216 / 347
  • Number of attempts: 2
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 27
  • Position: #273 / 281
  • Number of attempts: 1
Space out the alphabet - 1657 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 32
  • Position: #428 / 444
  • Number of attempts: 1
remove all lines in first part - 211 entries

From the second part, remove all lines in the first part. It can be useful when you have done something from a long list, you want to know what is not done yet!

  • Best score: 13
  • Best player score: 29
  • Position: #66 / 67
  • Number of attempts: 1
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: #236 / 290
  • Number of attempts: 1
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: 21
  • Position: #92 / 96
  • Number of attempts: 1
Happy TvvO - 427 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 14
  • Position: #192 / 206
  • Number of attempts: 3
I forgot quotes - 15983 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #2790 / 4180
  • Number of attempts: 1
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #788 / 1137
  • Number of attempts: 2
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #219 / 354
  • Number of attempts: 2
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 14
  • Position: #217 / 271
  • Number of attempts: 2
Don't know what this is - 2022 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: 16
  • Position: #486 / 585
  • Number of attempts: 1
attr_aligner - 3520 entries

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

  • Best score: 19
  • Best player score: 34
  • Position: #570 / 702
  • Number of attempts: 2
Letter case trickery - 1630 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: 28
  • Position: #513 / 518
  • Number of attempts: 1
quotes inside quotes - 3159 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: 17
  • Position: #862 / 1078
  • Number of attempts: 3
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 18
  • Position: #2861 / 3963
  • Number of attempts: 3
abcd > a b c d - 291 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #151 / 222
  • Number of attempts: 1
NATO phonetic alphabet - 529 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 23
  • Position: #137 / 196
  • Number of attempts: 1
A simple change - 461 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #110 / 191
  • Number of attempts: 1
lamb had a little Mary - 609 entries

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

  • Best score: 16
  • Best player score: 43
  • Position: #146 / 168
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1606 entries

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

  • Best score: 8
  • Best player score: 11
  • Position: #277 / 446
  • Number of attempts: 3
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 10
  • Position: #360 / 445
  • Number of attempts: 1
Vertical Limit - 2538 entries

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

  • Best score: 21
  • Best player score: 53
  • Position: #747 / 754
  • Number of attempts: 1
replacing each line of a block selection - 2999 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 29
  • Position: #633 / 777
  • Number of attempts: 3
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #486 / 663
  • Number of attempts: 2
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #338 / 419
  • Number of attempts: 4
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1379 / 1748
  • Number of attempts: 3
Make it more readable - 2005 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Position: #286 / 650
  • Number of attempts: 3
Line Zipper - 473 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #189 / 215
  • Number of attempts: 1
Alphabetize the directory - 298 entries

Put the contacts and their information in alphabetical order.

  • Best score: 30
  • Best player score: 47
  • Position: #94 / 101
  • Number of attempts: 1
Case preserving word replacement - 454 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 24
  • Position: #158 / 180
  • Number of attempts: 1
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Position: #407 / 652
  • Number of attempts: 1
Ruby 1.9 hashes - 1244 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: 18
  • Position: #348 / 406
  • Number of attempts: 2
A Simple One - 1050 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #403 / 664
  • Number of attempts: 1
Ruby 1.9 compat - 629 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: 15
  • Position: #113 / 234
  • Number of attempts: 5
Sorting paragraphs - 534 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 36
  • Position: #110 / 163
  • Number of attempts: 1
Hatsuyume - 532 entries

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

  • Best score: 15
  • Best player score: 39
  • Position: #174 / 186
  • Number of attempts: 1
The Cake is a Lie - 1346 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 12
  • Position: #487 / 527
  • Number of attempts: 3
Context insensitive completion 0 - 577 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: 8
  • Position: #146 / 246
  • Number of attempts: 3
Make Fancy Header - 1052 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 27
  • Position: #318 / 344
  • Number of attempts: 2
Reverse characters in a line - 771 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: 20
  • Position: #205 / 265
  • Number of attempts: 1
Sort and add attributes - 1451 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #190 / 563
  • Number of attempts: 3
William Ott
Twitter:

Wishing for a thing does not make it so. - Captain Picard

entered into 47 challenges

contributed 0 challenges