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

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

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

Based on "The name of the game".

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

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 15
  • Position: #2864 / 3687
  • Number of attempts: 1
attr_aligner - 3522 entries

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

  • Best score: 19
  • Best player score: 33
  • Position: #512 / 703
  • Number of attempts: 1
Letter case trickery - 1630 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: #310 / 518
  • Number of attempts: 1
quotes inside quotes - 3165 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: #1012 / 1079
  • Number of attempts: 1
Words in parens - 12966 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1294 / 3968
  • Number of attempts: 2
Hole-in-one - 1018 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: #260 / 304
  • Number of attempts: 1
Saving the hashes(#) - 2063 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: #249 / 480
  • Number of attempts: 5
Aligning function arguments to match a specific coding style - 259 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: #38 / 72
  • Number of attempts: 5
replacing each line of a block selection - 3001 entries

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

  • Best score: 18
  • Best player score: 27
  • Position: #584 / 778
  • Number of attempts: 4
Switch function arguments - 2140 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 15
  • Position: #552 / 664
  • Number of attempts: 1
switch variable - 5079 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 22
  • Position: #1688 / 1749
  • Number of attempts: 1
Assignment Alignment - 883 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 19
  • Position: #69 / 220
  • Number of attempts: 6
Reformat a C golf submission - 612 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: #113 / 209
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3727 entries

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

  • Best score: 16
  • Best player score: 38
  • Position: #725 / 800
  • Number of attempts: 1
Simple text editing with Vim - 12929 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2218 / 3723
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 7099 entries

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

  • Best score: 28
  • Best player score: 39
  • Position: #729 / 1741
  • Number of attempts: 2
Johan Berg
Twitter:

entered into 18 challenges

contributed 0 challenges