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

Separating firstname & lastname - 102 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 24
  • Number of attempts: 3
Do you demand a shrubbery? - 1016 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 22
  • Number of attempts: 1
Compile C - 278 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 21
  • Number of attempts: 5
readability - 285 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 1
NBCU Weekly Challenge - Test - 215 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 1
swap or reverse - 88 entries

Try to swap or reverse the line as needed.

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 1
remove dupes from array - 1195 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
Space out the alphabet - 1377 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 6
I forgot quotes - 11957 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Number of attempts: 1
Generate a list of numbers - 249 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 3
quotes inside quotes - 2793 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
ASCII box - 295 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 29
  • Number of attempts: 1
Line Zipper - 397 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 1
The holy-grail may help - 301 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.... - 489 entries

Vim likes macros

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

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
Mute the second method of this script - 411 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 2
Reconstruct the Sentence - 1024 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
Wrap the text of an email message to 79 characters - 488 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
Shuffled numbers - 199 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
A HAPPY NEW YEAR 2014 ! - 9545 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 3
Switch function arguments - 1837 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 5
Gray area - 639 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 2
Case preserving word replacement - 389 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
Extract argument from function - 2010 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
V to the i - 3952 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Context insensitive completion 0 - 444 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
  • Number of attempts: 2
Delete unwanted lines - 336 entries

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

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
Append semicolon after expressions - 860 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Where should I put the Newline? - 798 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
lamb had a little Mary - 491 entries

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

  • Best score: 16
  • Best player score: 25
  • Number of attempts: 4
Basic renumbering - 4613 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 19
  • Number of attempts: 4
Numbering a List - 1733 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Number of attempts: 7
camel riding - 691 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 4
Fix the XML - 867 entries

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

  • Best score: 18
  • Best player score: 20
  • Number of attempts: 8
Happy TvvO - 354 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 1
That hyphen - 2201 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Number of attempts: 1
Simple text editing with Vim - 10457 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
Words in parens - 11097 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 1
Condensed Cases - 693 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
Reverse characters in a line - 575 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
VimGolfNight - 458 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Remove hard line breaks - 39 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
-a-b-c- - 2607 entries

Put hyphens everywhere.

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

Programmer, cheese lover, software engineer at Google

entered into 44 challenges

contributed 0 challenges