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

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

  • Best score: 7
  • Best player score: 7
  • Position: #209 / 1859
  • Number of attempts: 3
Wrap the text of an email message to 79 characters - 601 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #211 / 360
  • Number of attempts: 1
Extract argument from function - 2257 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #123 / 733
  • Number of attempts: 4
That hyphen - 2512 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #428 / 685
  • Number of attempts: 1
Just the middle - 11261 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1816 / 4135
  • Number of attempts: 1
Basic renumbering - 5449 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 19
  • Position: #718 / 1231
  • Number of attempts: 4
Generate a list of numbers - 278 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 16
  • Position: #114 / 132
  • Number of attempts: 3
Separating firstname & lastname - 113 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 24
  • Position: #25 / 53
  • Number of attempts: 3
VimGolfNight - 507 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #219 / 332
  • Number of attempts: 2
camel riding - 747 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 15
  • Position: #24 / 268
  • Number of attempts: 4
swap or reverse - 104 entries

Try to swap or reverse the line as needed.

  • Best score: 16
  • Best player score: 16
  • Position: #30 / 62
  • Number of attempts: 1
readability - 306 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 18
  • Position: #46 / 145
  • Number of attempts: 1
Space out the alphabet - 1595 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 16
  • Position: #110 / 434
  • Number of attempts: 6
Fix the XML - 958 entries

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

  • Best score: 18
  • Best player score: 20
  • Position: #73 / 279
  • Number of attempts: 8
Shuffled numbers - 216 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: 17
  • Position: #71 / 89
  • Number of attempts: 1
ASCII box - 324 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 29
  • Position: #86 / 103
  • Number of attempts: 1
Mute the second method of this script - 439 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Position: #85 / 233
  • Number of attempts: 2
Remove hard line breaks - 61 entries

Text files with Hard breaks are not good for e-readers. We need remove all hard line breaks and have long lines.

  • Best score: 10
  • Best player score: 14
  • Position: #16 / 29
  • Number of attempts: 1
Condensed Cases - 758 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: 14
  • Position: #133 / 231
  • Number of attempts: 3
Happy TvvO - 392 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #94 / 195
  • Number of attempts: 1
I forgot quotes - 15769 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Position: #2416 / 4119
  • Number of attempts: 1
-a-b-c- - 3125 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #553 / 1114
  • Number of attempts: 1
NBCU Weekly Challenge - Test - 233 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Position: #44 / 112
  • Number of attempts: 1
Gray area - 707 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 13
  • Position: #169 / 261
  • Number of attempts: 2
Do you demand a shrubbery? - 1107 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 22
  • Position: #181 / 292
  • Number of attempts: 1
Where should I put the Newline? - 845 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #347 / 422
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10555 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #715 / 3642
  • Number of attempts: 3
quotes inside quotes - 3051 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: #598 / 1050
  • Number of attempts: 2
Words in parens - 12769 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1443 / 3925
  • Number of attempts: 1
Delete unwanted lines - 387 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 9
  • Position: #149 / 220
  • Number of attempts: 1
lamb had a little Mary - 563 entries

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

  • Best score: 16
  • Best player score: 25
  • Position: #43 / 158
  • Number of attempts: 4
Switch function arguments - 1993 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #264 / 630
  • Number of attempts: 5
Append semicolon after expressions - 968 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #85 / 391
  • Number of attempts: 1
Line Zipper - 448 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #186 / 208
  • Number of attempts: 1
remove dupes from array - 1308 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: 25
  • Position: #239 / 327
  • Number of attempts: 1
Case preserving word replacement - 439 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: 20
  • Position: #74 / 176
  • Number of attempts: 4
Numbering a List - 1834 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Position: #126 / 629
  • Number of attempts: 7
The holy-grail may help - 324 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #138 / 197
  • Number of attempts: 1
Increment, increment, increment.... - 599 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #292 / 382
  • Number of attempts: 1
Context insensitive completion 0 - 476 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: 7
  • Best player score: 8
  • Position: #131 / 224
  • Number of attempts: 2
Compile C - 341 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 21
  • Position: #68 / 126
  • Number of attempts: 5
Reverse characters in a line - 657 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: 17
  • Position: #154 / 239
  • Number of attempts: 1
Reconstruct the Sentence - 1168 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: 21
  • Position: #193 / 350
  • Number of attempts: 4
Simple text editing with Vim - 11705 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1377 / 3430
  • Number of attempts: 1
Clark DuVall
Twitter:

Programmer, cheese lover, software engineer at Google

entered into 44 challenges

contributed 0 challenges