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

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

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

Based on "The name of the game".

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

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Position: #41 / 104
  • Number of attempts: 1
Where should I put the Newline? - 883 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #272 / 438
  • Number of attempts: 3
Vim tetris - 371 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 27
  • Position: #64 / 104
  • Number of attempts: 2
Mess in revision history - 1210 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 17
  • Position: #22 / 254
  • Number of attempts: 9
HTML formatting: vertical alignment for readability - 88 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: 32
  • Best player score: 33
  • Position: #10 / 36
  • Number of attempts: 3
Split the words - 372 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 / 112
  • Number of attempts: 5
A HAPPY NEW YEAR 2014 ! - 10713 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1848 / 3700
  • Number of attempts: 1
attr_aligner - 3525 entries

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

  • Best score: 19
  • Best player score: 19
  • Position: #69 / 706
  • Number of attempts: 11
Letter case trickery - 1644 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: #252 / 520
  • Number of attempts: 1
Words in parens - 12992 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #412 / 3977
  • Number of attempts: 9
Pairs of numbers - 364 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: #59 / 137
  • Number of attempts: 1
Hole-in-one - 1024 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: #66 / 305
  • Number of attempts: 5
Delete unwanted lines - 431 entries

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

  • Best score: 9
  • Best player score: 9
  • Position: #134 / 234
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1620 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 / 450
  • Number of attempts: 8
Let's play some Ivmgolf - 1138 entries

Oops, I spelled that wrong.

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

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

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

How to switch two arguments of a function.

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

Some lines need the semicolon, some don't.

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

how fast can you switch two variable ?

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

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 14
  • Position: #167 / 652
  • Number of attempts: 6
remove dupes from array - 1360 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: #151 / 337
  • Number of attempts: 3
Numbering a List - 1940 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Position: #331 / 656
  • Number of attempts: 4
Shebangs for all - 2049 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 / 523
  • Number of attempts: 12
Change the content of a string - 1707 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #309 / 628
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3852 entries

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

  • Best score: 16
  • Best player score: 38
  • Position: #749 / 829
  • Number of attempts: 1
Simple text editing with Vim - 13262 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1337 / 3810
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 7389 entries

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

  • Best score: 7
  • Best player score: 34
  • Position: #311 / 1825
  • Number of attempts: 4
playalong
Twitter:

entered into 29 challenges

contributed 0 challenges