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

comments galore - 928 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 5
prepend * to every non-blank line - 4411 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 5
Letter case trickery - 1481 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: 2
Swap values inside brackets - 2257 entries

Easy challenge.

  • Best score: 14
  • Best player score: 17
  • Number of attempts: 4
Remember VimGolf Rules ! - 215 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
Array propagate - 268 entries

Complete the array with the keys as part of the value

  • Best score: 23
  • Best player score: 36
  • Number of attempts: 1
Adam's challenge - 889 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 23
  • Number of attempts: 4
Make HTML List - 923 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 55
  • Number of attempts: 1
From A to B - 532 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 5
Vertical Limit - 2252 entries

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

  • Best score: 21
  • Best player score: 23
  • Number of attempts: 3
Simple, Practical, and Common - 31281 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 5
comment and uncomment code inline - 948 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 5
Just the middle - 10701 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
I forgot quotes - 14971 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 7
The Universal Declaration of Human Rights, Article 1 - 129 entries

Somebody's got this slightly muddled up. See how quickly you can fix it. (I made this to experiment with buffers. I'm not actually sure whether this is faster with buffers or without.)

  • Best score: 24
  • Best player score: 24
  • Number of attempts: 2
Saving the hashes(#) - 1876 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: 25
  • Number of attempts: 4
Align commas - 957 entries

There are 15,000 aligning challenges on vimgolf.com, and they're all exactly the same. I hope this one is a little different.

  • Best score: 11
  • Best player score: 19
  • Number of attempts: 3
Switch function arguments - 1888 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 4
Two become one - 692 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 28
  • Number of attempts: 3
Wrap text in quotes - 311 entries

All the blocks of text should be wrapped in quotation marks.

  • Best score: 16
  • Best player score: 23
  • Number of attempts: 2
switch variable - 4741 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 2
Unwrap the text of an email message - 154 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 26
  • Number of attempts: 2
Simple addition - 261 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 4
chaotic
Twitter:

entered into 23 challenges

contributed 0 challenges