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

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

  • Best score: 12
  • Best player score: 12
  • Position: #331 / 1549
  • Number of attempts: 3
VimGolfNight - 505 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #179 / 330
  • Number of attempts: 1
Neither Fizz nor Buzz - 221 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Position: #36 / 97
  • 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: #264 / 422
  • Number of attempts: 3
Vim tetris - 351 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 27
  • Position: #62 / 100
  • Number of attempts: 2
Mess in revision history - 1143 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 17
  • Position: #22 / 242
  • Number of attempts: 9
HTML formatting: vertical alignment for readability - 60 entries

We did this a VimGolf challenge at work and now that we have finished I want to see if you guys can come up with something even better than we could. Our best solution was 44 keystrokes.

  • Best score: 33
  • Best player score: 33
  • Position: #9 / 32
  • Number of attempts: 3
Split the words - 353 entries

Add the spaces manually if you must, but if you use Vim's spell checking feature wisely, I think you'll save a LARGE number of strokes.

  • Best score: 18
  • Best player score: 18
  • Position: #7 / 106
  • Number of attempts: 5
A HAPPY NEW YEAR 2014 ! - 10538 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1811 / 3638
  • Number of attempts: 1
attr_aligner - 3402 entries

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

  • Best score: 19
  • Best player score: 19
  • Position: #69 / 685
  • Number of attempts: 11
Letter case trickery - 1553 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: 11
  • Position: #244 / 500
  • Number of attempts: 1
Words in parens - 12736 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #392 / 3919
  • Number of attempts: 9
Pairs of numbers - 345 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: 34
  • Position: #56 / 129
  • Number of attempts: 1
Hole-in-one - 978 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: 16
  • Position: #64 / 298
  • Number of attempts: 5
Delete unwanted lines - 358 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #134 / 215
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1510 entries

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

  • Best score: 8
  • Best player score: 8
  • Position: #55 / 424
  • Number of attempts: 8
Let's play some Ivmgolf - 1015 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #66 / 420
  • Number of attempts: 3
Vertical Limit - 2370 entries

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

  • Best score: 21
  • Best player score: 21
  • Position: #29 / 718
  • Number of attempts: 7
Switch function arguments - 1982 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #98 / 627
  • Number of attempts: 3
Append semicolon after expressions - 953 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #73 / 387
  • Number of attempts: 4
switch variable - 4944 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #306 / 1708
  • Number of attempts: 2
Make it more readable - 1905 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #159 / 625
  • Number of attempts: 6
remove dupes from array - 1290 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: 21
  • Position: #144 / 325
  • Number of attempts: 3
Numbering a List - 1832 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Position: #310 / 627
  • Number of attempts: 4
Shebangs for all - 1777 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 11
  • Position: #25 / 468
  • Number of attempts: 12
Change the content of a string - 1350 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #250 / 521
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3009 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 38
  • Position: #610 / 667
  • Number of attempts: 1
Simple text editing with Vim - 11657 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1257 / 3418
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 6033 entries

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

  • Best score: 32
  • Best player score: 34
  • Position: #296 / 1486
  • Number of attempts: 4
playalong
Twitter:

entered into 29 challenges

contributed 0 challenges