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 - 33958 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: #2476 / 7498
  • Number of attempts: 6
Just the middle - 11572 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 9
  • Position: #3245 / 4240
  • Number of attempts: 1
O Christmas Tree - 109 entries

Design a macro that makes trees grow (or ASCII triangles, if that's too hard).

  • Best score: 22
  • Best player score: 26
  • Position: #15 / 43
  • Number of attempts: 2
Condensed Cases - 820 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: 15
  • Position: #153 / 251
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10743 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1642 / 3710
  • Number of attempts: 2
Words in parens - 13024 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2037 / 3983
  • Number of attempts: 1
Changing URL path in CSS - 144 entries

What's the quickest way to swap out all the URLs in a CSS file? Is it wasted keystrokes using look-behinds and look-aheads? (I'm sorry for the delete/report--I made a mistake with the last one requiring an ugly search for graphic to replace with images. I just intended this to be a simple search and replace that might possibly generate some macros or normals solutions that are quicker)

  • Best score: 40
  • Best player score: 40
  • Position: #5 / 65
  • Number of attempts: 2
Cleanining up 80 column concatenated text - 207 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

  • Best score: 31
  • Best player score: 39
  • Position: #35 / 81
  • Number of attempts: 2
Inconsistent real estate paste - 217 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

  • Best score: 24
  • Best player score: 42
  • Position: #39 / 59
  • Number of attempts: 1
Exchanging Quotes - 864 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 32
  • Position: #47 / 232
  • Number of attempts: 4
replacing each line of a block selection - 3040 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #345 / 785
  • Number of attempts: 1
Switch function arguments - 2195 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #10 / 678
  • Number of attempts: 3
Append semicolon after expressions - 1067 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #148 / 423
  • Number of attempts: 3
Reverse and double space - 502 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 15
  • Position: #74 / 200
  • Number of attempts: 1
constructor - 182 entries

coding a constructor for a simple class

  • Best score: 59
  • Best player score: 125
  • Position: #45 / 60
  • Number of attempts: 4
switch variable - 5110 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1058 / 1758
  • Number of attempts: 1
The meaning - 577 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #33 / 364
  • Number of attempts: 1
Ugly spreadsheet copy/paste to CSV - 1016 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 21
  • Position: #42 / 196
  • Number of attempts: 3
Simple text editing with Vim - 13468 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1222 / 3865
  • Number of attempts: 2
Tibor Claassen
Twitter:

entered into 19 challenges

contributed 0 challenges