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

Generate a list of numbers - 262 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 3
swap or reverse - 98 entries

Try to swap or reverse the line as needed.

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 1
readability - 298 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 1
Shuffled numbers - 203 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
  • Number of attempts: 1
camel riding - 731 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 4
Remove hard line breaks - 41 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
  • Number of attempts: 1
Fix the XML - 921 entries

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

  • Best score: 18
  • Best player score: 20
  • Number of attempts: 8
ASCII box - 303 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 29
  • Number of attempts: 1
Space out the alphabet - 1482 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 6
Mute the second method of this script - 420 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Separating firstname & lastname - 107 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 24
  • Number of attempts: 3
Happy TvvO - 370 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
Just the middle - 10891 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Condensed Cases - 729 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
  • Number of attempts: 3
I forgot quotes - 15243 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Number of attempts: 1
Basic renumbering - 5311 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 19
  • Number of attempts: 4
Gray area - 669 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 2
That hyphen - 2411 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Number of attempts: 1
-a-b-c- - 3008 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 1
NBCU Weekly Challenge - Test - 227 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 1
V to the i - 4523 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Do you demand a shrubbery? - 1056 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 22
  • Number of attempts: 1
Where should I put the Newline? - 830 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Extract argument from function - 2146 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 10391 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
VimGolfNight - 478 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
quotes inside quotes - 2973 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
  • Number of attempts: 2
Delete unwanted lines - 350 entries

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

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
Words in parens - 12439 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 1
lamb had a little Mary - 537 entries

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

  • Best score: 16
  • Best player score: 25
  • Number of attempts: 4
Switch function arguments - 1899 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 5
Append semicolon after expressions - 899 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
remove dupes from array - 1260 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
  • Number of attempts: 1
Line Zipper - 402 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 1
Case preserving word replacement - 395 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
  • Number of attempts: 4
Numbering a List - 1766 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Number of attempts: 7
The holy-grail may help - 304 entries

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

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 1
Increment, increment, increment.... - 530 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
Compile C - 281 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 21
  • Number of attempts: 5
Context insensitive completion 0 - 461 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
  • Number of attempts: 2
Reverse characters in a line - 602 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
  • Number of attempts: 1
Wrap the text of an email message to 79 characters - 521 entries

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

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Reconstruct the Sentence - 1042 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
  • Number of attempts: 4
Simple text editing with Vim - 11231 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 1
Clark DuVall
Twitter:

Programmer, cheese lover, software engineer at Google

entered into 44 challenges

contributed 0 challenges