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

Simple, Practical, and Common - 33724 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
  • Position: #2449 / 7442
  • Number of attempts: 7
One number per line - 18755 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Position: #2070 / 3870
  • Number of attempts: 3
Extract argument from function - 2364 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 18
  • Position: #656 / 755
  • Number of attempts: 1
Start coding format - 155 entries

I used to start coding with following format: int main(){ -(cursor here) }

  • Best score: 22
  • Best player score: 24
  • Position: #55 / 72
  • Number of attempts: 2
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #445 / 701
  • Number of attempts: 2
Python Hello World! Reformatting - 1000 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 44
  • Position: #240 / 382
  • Number of attempts: 1
Vice versa - 7945 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #318 / 2138
  • Number of attempts: 6
Align commas - 1095 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: 15
  • Position: #123 / 246
  • Number of attempts: 4
Swap assigned value - 655 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #173 / 256
  • Number of attempts: 1
Mute the second method of this script - 455 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 10
  • Position: #204 / 239
  • Number of attempts: 2
Condensed Cases - 804 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 13
  • Position: #86 / 247
  • Number of attempts: 5
I forgot quotes - 16022 entries

Oops.

  • Best score: 10
  • Best player score: 12
  • Position: #1259 / 4189
  • Number of attempts: 3
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #197 / 1138
  • Number of attempts: 5
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 14
  • Position: #224 / 271
  • Number of attempts: 2
Don't know what this is - 2024 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 16
  • Position: #503 / 586
  • Number of attempts: 2
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: 13
  • Position: #406 / 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: 16
  • Position: #623 / 1079
  • Number of attempts: 3
Block Fun 1 - 210 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 24
  • Position: #58 / 75
  • Number of attempts: 3
HTML to Haml - 881 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 45
  • Position: #145 / 205
  • Number of attempts: 1
Numbering a List - 1935 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Position: #271 / 654
  • Number of attempts: 6
Ryan Marcotte
Twitter:

entered into 20 challenges

contributed 0 challenges