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

V to the i - 4796 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #138 / 1891
  • Number of attempts: 5
From argument to object - 1503 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 23
  • Position: #400 / 455
  • Number of attempts: 2
comment and uncomment code inline - 1114 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: 12
  • Position: #236 / 320
  • Number of attempts: 3
Just the middle - 11417 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #303 / 4181
  • Number of attempts: 11
Stairstep digits - 392 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #89 / 144
  • Number of attempts: 1
Basic renumbering - 5643 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Position: #840 / 1261
  • Number of attempts: 1
Cartesian product - 248 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 157
  • Position: #93 / 94
  • Number of attempts: 1
Fix the XML - 1035 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 47
  • Position: #282 / 289
  • Number of attempts: 1
Happy TvvO - 426 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 13
  • Position: #164 / 205
  • Number of attempts: 2
I forgot quotes - 15954 entries

Oops.

  • Best score: 10
  • Best player score: 19
  • Position: #3401 / 4170
  • Number of attempts: 5
A HAPPY NEW YEAR 2014 ! - 10654 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1950 / 3678
  • Number of attempts: 9
Words in parens - 12918 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 22
  • Position: #3554 / 3957
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 6825 entries

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

  • Best score: 28
  • Best player score: 82
  • Position: #1633 / 1673
  • Number of attempts: 2
Ayman Farhat
Twitter:

I craft software, solve people's problems and write about code. Customer Solutions Engineer at @Google. Opinions are my own and not the views of my employer.

entered into 13 challenges

contributed 0 challenges