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 - 33385 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: #2591 / 7364
  • Number of attempts: 4
Wget failed to download redirections - 184 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

  • Best score: 15
  • Best player score: 22
  • Position: #41 / 63
  • Number of attempts: 1
V to the i - 4751 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 8
  • Position: #944 / 1879
  • Number of attempts: 1
Extract argument from function - 2314 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #306 / 744
  • Number of attempts: 1
That hyphen - 2556 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Position: #300 / 695
  • Number of attempts: 1
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1515 / 4164
  • Number of attempts: 2
Team names - 1805 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #84 / 581
  • Number of attempts: 2
Basic renumbering - 5587 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 16
  • Position: #541 / 1258
  • Number of attempts: 2
Mute the second method of this script - 447 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 10
  • Position: #150 / 237
  • Number of attempts: 1
Refactoring useless Method away - 91 entries

Real-life challenge, convert a bunch of ifs to a switch statement

  • Best score: 47
  • Best player score: 49
  • Position: #7 / 32
  • Number of attempts: 6
Test everything! - 162 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

  • Best score: 22
  • Best player score: 36
  • Position: #38 / 52
  • Number of attempts: 1
Condensed Cases - 788 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: 14
  • Position: #116 / 242
  • Number of attempts: 1
Square numbers - 99 entries

Boring math puzzle.

  • Best score: 16
  • Best player score: 40
  • Position: #39 / 40
  • Number of attempts: 1
I forgot quotes - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1732 / 4161
  • Number of attempts: 5
Shift down - 193 entries

Number words are back.

  • Best score: 19
  • Best player score: 30
  • Position: #49 / 67
  • Number of attempts: 1
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #501 / 1129
  • Number of attempts: 2
Count both ways - 1001 entries

Right AND down.

  • Best score: 13
  • Best player score: 15
  • Position: #100 / 351
  • Number of attempts: 2
Gray area - 732 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 13
  • Position: #153 / 268
  • Number of attempts: 2
Refactor static member invocation - 198 entries

Someone used a static method. Refactor the method into a static import while fixing the assertion.

  • Best score: 28
  • Best player score: 29
  • Position: #20 / 63
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 14
  • Position: #2675 / 3666
  • Number of attempts: 3
Words in parens - 12854 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2158 / 3945
  • Number of attempts: 1
Vertical Limit - 2437 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #222 / 736
  • Number of attempts: 5
Switch function arguments - 2078 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Position: #390 / 651
  • Number of attempts: 2
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 20
  • Position: #324 / 639
  • Number of attempts: 2
Ruby 1.9 compat - 610 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 15
  • Position: #110 / 230
  • Number of attempts: 2
Change the content of a string - 1475 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 24
  • Position: #320 / 557
  • Number of attempts: 2
Simple text editing with Vim - 12281 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1346 / 3580
  • Number of attempts: 9
Reformat/Refactor a Golfer Class - 6557 entries

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

  • Best score: 32
  • Best player score: 34
  • Position: #305 / 1614
  • Number of attempts: 8
Josu Oyanguren
Twitter:

entered into 28 challenges

contributed 0 challenges