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

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

  • Best score: 12
  • Best player score: 12
  • Position: #280 / 1674
  • Number of attempts: 5
VimGolfNight - 602 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #141 / 356
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10757 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 15
  • Position: #2887 / 3716
  • Number of attempts: 1
attr_aligner - 3566 entries

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

  • Best score: 19
  • Best player score: 33
  • Position: #516 / 710
  • Number of attempts: 1
Letter case trickery - 1686 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: 12
  • Position: #316 / 525
  • Number of attempts: 1
quotes inside quotes - 3202 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: 21
  • Position: #1024 / 1093
  • Number of attempts: 1
Words in parens - 13053 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1305 / 3991
  • Number of attempts: 2
Hole-in-one - 1040 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: 23
  • Position: #263 / 307
  • Number of attempts: 1
Saving the hashes(#) - 2116 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 27
  • Position: #254 / 488
  • Number of attempts: 5
Aligning function arguments to match a specific coding style - 279 entries

Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.

  • Best score: 16
  • Best player score: 18
  • Position: #40 / 75
  • Number of attempts: 5
replacing each line of a block selection - 3067 entries

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

  • Best score: 18
  • Best player score: 27
  • Position: #592 / 789
  • Number of attempts: 4
Switch function arguments - 2229 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 15
  • Position: #568 / 684
  • Number of attempts: 1
switch variable - 5128 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 22
  • Position: #1701 / 1764
  • Number of attempts: 1
Assignment Alignment - 909 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 19
  • Position: #70 / 226
  • Number of attempts: 6
Reformat a C golf submission - 678 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 22
  • Best player score: 32
  • Position: #118 / 220
  • Number of attempts: 1
Whitespace, empty lines and tabs - 4044 entries

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

  • Best score: 16
  • Best player score: 38
  • Position: #775 / 862
  • Number of attempts: 1
Simple text editing with Vim - 13626 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2314 / 3902
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 7681 entries

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

  • Best score: 7
  • Best player score: 39
  • Position: #773 / 1889
  • Number of attempts: 2
Johan Berg
Twitter:

entered into 18 challenges

contributed 0 challenges