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

attr_aligner - 2795 entries

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

  • Best score: 19
  • Best player score: 33
  • Number of attempts: 1
Whitespace, empty lines and tabs - 2508 entries

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

  • Best score: 16
  • Best player score: 38
  • Number of attempts: 1
Reformat a C golf submission - 464 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: 23
  • Best player score: 32
  • Number of attempts: 1
Hole-in-one - 929 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
  • Number of attempts: 1
switch variable - 4095 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 22
  • Number of attempts: 1
Switch function arguments - 1785 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 1
VimGolfNight - 449 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 5358 entries

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

  • Best score: 32
  • Best player score: 39
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 9081 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 15
  • Number of attempts: 1
Search and Replace 0 - 3841 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 5
Words in parens - 10374 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 2
Simple text editing with Vim - 9933 entries

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

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 3
Letter case trickery - 1413 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
  • Number of attempts: 1
Aligning function arguments to match a specific coding style - 151 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
  • Number of attempts: 5
Saving the hashes(#) - 1686 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
  • Number of attempts: 5
Assignment Alignment - 651 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 19
  • Number of attempts: 6
replacing each line of a block selection - 2398 entries

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

  • Best score: 17
  • Best player score: 27
  • Number of attempts: 4
quotes inside quotes - 2647 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: 2
  • Best player score: 21
  • Number of attempts: 1
Johan Berg
Twitter:

entered into 18 challenges

contributed 0 challenges