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: 33
  • Position: #6028 / 7442
  • Number of attempts: 3
V to the i - 4813 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1066 / 1897
  • Number of attempts: 3
Search and Replace 0 - 5004 entries

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

  • Best score: 12
  • Best player score: 15
  • Position: #1123 / 1630
  • Number of attempts: 2
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 13
  • Position: #513 / 701
  • Number of attempts: 6
Just the middle - 11484 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #396 / 4209
  • Number of attempts: 7
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: #238 / 382
  • Number of attempts: 2
Basic renumbering - 5683 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 19
  • Position: #751 / 1269
  • Number of attempts: 3
Vice versa - 7945 entries

Little role switching.

  • Best score: 12
  • Best player score: 18
  • Position: #1720 / 2138
  • Number of attempts: 6
Assign numbers to fields - 116 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

  • Best score: 19
  • Best player score: 47
  • Position: #60 / 62
  • Number of attempts: 4
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 14
  • Position: #230 / 269
  • Number of attempts: 1
Collect List - 4305 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 28
  • Position: #1168 / 1191
  • Number of attempts: 2
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 18
  • Position: #228 / 281
  • Number of attempts: 1
Space out the alphabet - 1659 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 27
  • Position: #405 / 446
  • Number of attempts: 2
Pretty format for variable declarations - 170 entries

Project standards demand the equal signs must be aligned for better readability.

  • Best score: 13
  • Best player score: 17
  • Position: #41 / 64
  • Number of attempts: 3
I forgot quotes - 16022 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Position: #2488 / 4189
  • Number of attempts: 5
learn vim in short time - 240 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 9
  • Position: #144 / 161
  • Number of attempts: 2
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Position: #938 / 1138
  • Number of attempts: 2
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 14
  • Position: #221 / 271
  • Number of attempts: 6
Do you demand a shrubbery? - 1158 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 32
  • Position: #268 / 300
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10682 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 17
  • Position: #3376 / 3689
  • Number of attempts: 3
Words in parens - 12967 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 21
  • Position: #3468 / 3969
  • Number of attempts: 3
The name of the game - 671 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #195 / 362
  • Number of attempts: 3
lamb had a little Mary - 618 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 43
  • Position: #148 / 169
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1606 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #222 / 446
  • Number of attempts: 2
Let's play some Ivmgolf - 1122 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 15
  • Position: #433 / 446
  • Number of attempts: 1
switch variable - 5079 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 18
  • Position: #1637 / 1749
  • Number of attempts: 2
Case preserving word replacement - 454 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 37
  • Position: #176 / 180
  • Number of attempts: 1
Ruby 1.9 hashes - 1249 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 15
  • Position: #281 / 407
  • Number of attempts: 4
Shebangs for all - 2018 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 17
  • Position: #358 / 519
  • Number of attempts: 4
A Simple One - 1057 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

  • Best score: 9
  • Best player score: 9
  • Position: #413 / 667
  • Number of attempts: 1
The Cake is a Lie - 1365 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #211 / 532
  • Number of attempts: 5
Change the content of a string - 1593 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 24
  • Position: #348 / 594
  • Number of attempts: 3
Simple text editing with Vim - 12996 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1464 / 3739
  • Number of attempts: 6
Reformat/Refactor a Golfer Class - 7157 entries

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

  • Best score: 28
  • Best player score: 48
  • Position: #1333 / 1755
  • Number of attempts: 1
Andrew Michaud
Twitter:

Programmer jerk, Linux jerk, anime jerk, jerk jerk. (He/him)

entered into 34 challenges

contributed 0 challenges