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 - 33353 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: 25
  • Position: #3130 / 7358
  • Number of attempts: 5
Swap values - 4535 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #6 / 1255
  • Number of attempts: 7
V to the i - 4743 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #940 / 1878
  • Number of attempts: 4
Add semicolons - 10785 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #178 / 3042
  • Number of attempts: 5
Extract argument from function - 2308 entries

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

  • Best score: 13
  • Best player score: 17
  • Position: #585 / 742
  • Number of attempts: 1
Search and Replace 0 - 4790 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 12
  • Position: #363 / 1585
  • Number of attempts: 4
That hyphen - 2554 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #429 / 694
  • Number of attempts: 6
Just the middle - 11346 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #254 / 4160
  • Number of attempts: 3
Basic renumbering - 5584 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 30
  • Position: #1207 / 1257
  • Number of attempts: 1
readability - 312 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 18
  • Position: #36 / 148
  • Number of attempts: 4
Fix the XML - 996 entries

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

  • Best score: 18
  • Best player score: 26
  • Position: #189 / 284
  • Number of attempts: 5
I forgot quotes - 15922 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #168 / 4159
  • Number of attempts: 4
learn vim in short time - 229 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Position: #51 / 157
  • Number of attempts: 2
Count both ways - 997 entries

Right AND down.

  • Best score: 13
  • Best player score: 18
  • Position: #317 / 350
  • Number of attempts: 3
NBCU Weekly Challenge - Test - 243 entries

Just testing.

  • Best score: 18
  • Best player score: 21
  • Position: #107 / 114
  • Number of attempts: 5
Winding path - 93 entries

It's a maze, but the bad paths have been blocked off. Mark the correct path.

  • Best score: 27
  • Best player score: 96
  • Position: #36 / 40
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10616 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 20
  • Position: #3524 / 3663
  • Number of attempts: 2
quotes inside quotes - 3124 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: 14
  • Position: #178 / 1071
  • Number of attempts: 10
SFD-ROC: vimvimvim - 1569 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 8
  • Position: #64 / 437
  • Number of attempts: 4
Saving the hashes(#) - 1992 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: 29
  • Position: #332 / 473
  • Number of attempts: 7
Vertical Limit - 2436 entries

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

  • Best score: 21
  • Best player score: 26
  • Position: #455 / 735
  • Number of attempts: 4
replacing each line of a block selection - 2925 entries

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

  • Best score: 18
  • Best player score: 28
  • Position: #595 / 764
  • Number of attempts: 3
Rotating Philosophers Problem - 388 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

  • Best score: 29
  • Best player score: 32
  • Position: #117 / 163
  • Number of attempts: 4
The Cake is a Lie - 1284 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #197 / 511
  • Number of attempts: 4
Simple text editing with Vim - 12230 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1348 / 3567
  • Number of attempts: 8
Wade
Twitter:

entered into 25 challenges

contributed 0 challenges