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

Search and Replace 0 - 4792 entries

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

  • Best score: 12
  • Best player score: 18
  • Position: #1296 / 1585
  • Number of attempts: 1
Counting in binary - 477 entries

"a" represents 0; "A" represents 1. Start from zero and count to 15.

  • Best score: 16
  • Best player score: 22
  • Position: #32 / 113
  • Number of attempts: 3
quotes inside quotes - 3125 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: #673 / 1072
  • Number of attempts: 1
Number an outline - 249 entries

The indent and words are right, but the numbers are all wrong.

  • Best score: 25
  • Best player score: 67
  • Position: #60 / 75
  • Number of attempts: 2
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #1900 / 3946
  • Number of attempts: 1
Pairs of numbers - 360 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 49
  • Position: #109 / 133
  • Number of attempts: 1
Assign list - 169 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 40
  • Position: #28 / 59
  • Number of attempts: 3
Hole-in-one - 1012 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 19
  • Position: #155 / 302
  • Number of attempts: 1
Delete unwanted lines - 396 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #37 / 225
  • Number of attempts: 1
Lookahead and Lookbehind - 67 entries

Look everywhere

  • Best score: 16
  • Best player score: 20
  • Position: #10 / 29
  • Number of attempts: 2
Word frequency alignment - 276 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 5
  • Position: #70 / 158
  • Number of attempts: 1
REDRUM - 150 entries

If you remember "The Shinning", the first time you saw the bloody word REDRUM you probably thinked "What the Hell is that?" Well, then you know that you need a little help from a looking-glass to make sense of it. Now it's time to use vim like a mirror to reveal the message.

  • Best score: 14
  • Best player score: 28
  • Position: #49 / 62
  • Number of attempts: 1
Transposition - 82 entries

Transpose the original lines in separate columns, one for each line.

  • Best score: 31
  • Best player score: 51
  • Position: #22 / 30
  • Number of attempts: 1
abcd > a b c d - 280 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #101 / 218
  • Number of attempts: 1
Circle of Fifths with Sharps - 96 entries

Display a list of the Circle of Fifths with corresponding solfege syllables with sharps. Handling spaces may be tricky.

  • Best score: 24
  • Best player score: 29
  • Position: #21 / 36
  • Number of attempts: 3
The Quick Brown Fox Jumps Over The Lazy Vim - 401 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: #58 / 188
  • Number of attempts: 3
SFD-ROC: vimvimvim - 1581 entries

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

  • Best score: 8
  • Best player score: 14
  • Position: #339 / 439
  • Number of attempts: 2
SFD-ROC: Pipe Dreams - 101 entries

Move the pipes so they match the output.

  • Best score: 12
  • Best player score: 13
  • Position: #10 / 45
  • Number of attempts: 3
Unwrap the text of an email message - 185 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 24
  • Position: #47 / 72
  • Number of attempts: 2
replacing each line of a block selection - 2947 entries

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

  • Best score: 18
  • Best player score: 30
  • Position: #643 / 768
  • Number of attempts: 1
switch variable - 5036 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #166 / 1736
  • Number of attempts: 4
The meaning - 558 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 6
  • Position: #333 / 356
  • Number of attempts: 2
A Simple One - 1001 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: #331 / 643
  • Number of attempts: 1
Dumb to smart - 96 entries

Turn dumb quote to smart vim's way.

  • Best score: 28
  • Best player score: 29
  • Position: #16 / 54
  • Number of attempts: 3
Context insensitive completion 0 - 507 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: #187 / 232
  • Number of attempts: 1
Almost encrypted - 198 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 7
  • Position: #142 / 144
  • Number of attempts: 1
Simple text editing with Vim - 12290 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1064 / 3581
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 6560 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 32
  • Best player score: 39
  • Position: #686 / 1616
  • Number of attempts: 4
Tullio Facchinetti
Twitter:

Ricercatore universitario

entered into 28 challenges

contributed 0 challenges