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

Wrap the text of an email message to 79 characters - 576 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 5
  • Position: #180 / 352
  • Number of attempts: 2
Extract argument from function - 2215 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #61 / 728
  • Number of attempts: 4
Across-Down Flip - 45 entries

Do this instead of the Sunday crossword.

  • Best score: 23
  • Best player score: 26
  • Position: #7 / 23
  • Number of attempts: 2
Do you demand a shrubbery? - 1105 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 18
  • Position: #118 / 291
  • Number of attempts: 4
Where should I put the Newline? - 842 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #70 / 421
  • Number of attempts: 2
Vim tetris - 351 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 21
  • Position: #16 / 100
  • Number of attempts: 6
Mess in revision history - 1143 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 17
  • Position: #20 / 242
  • Number of attempts: 6
Shuffle puzzle - 307 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 15
  • Position: #55 / 100
  • Number of attempts: 8
attr_aligner - 3402 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 19
  • Position: #20 / 685
  • Number of attempts: 13
quotes inside quotes - 3026 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: 15
  • Position: #373 / 1044
  • Number of attempts: 3
Sort the VimGolf challenges by popularity - 338 entries

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

  • Best score: 15
  • Best player score: 16
  • Position: #39 / 102
  • Number of attempts: 3
Words in parens - 12736 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1171 / 3919
  • Number of attempts: 3
Word frequency alignment - 241 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 5
  • Position: #51 / 145
  • Number of attempts: 1
Minimalist Limerick - 503 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 33
  • Position: #45 / 167
  • Number of attempts: 5
Define to require - 118 entries

When JSHint is enabled, there's a rule that doesn't let you have more than 6 arguments in a function, so the moment you need to add a 7th argument, you need to do a refactoring.

  • Best score: 62
  • Best player score: 63
  • Position: #9 / 48
  • Number of attempts: 7
REDRUM - 139 entries

If you remember "The Shinning", the first time you saw the bloody word REDRUM you probably thinked "What the Hell is that?" Well, then you know that you need a little help from a looking-glass to make sense of it. Now it's time to use vim like a mirror to reveal the message.

  • Best score: 14
  • Best player score: 17
  • Position: #34 / 58
  • Number of attempts: 2
Circle in a square - 125 entries

Probably looks more like "Egg in a rectangle" in most fonts, but it's actually 23x23.

  • Best score: 23
  • Best player score: 29
  • Position: #18 / 48
  • Number of attempts: 6
Prefixes and suffixes - 567 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 23
  • Position: #51 / 185
  • Number of attempts: 5
Refactor arguments into object argument - 160 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 56
  • Position: #13 / 64
  • Number of attempts: 1
Vertical Limit - 2367 entries

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

  • Best score: 21
  • Best player score: 22
  • Position: #126 / 716
  • Number of attempts: 7
switch variable - 4917 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #146 / 1701
  • Number of attempts: 4
The meaning - 521 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #179 / 336
  • Number of attempts: 1
Sort the cardinal numbers - 274 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 16
  • Position: #126 / 140
  • Number of attempts: 2
A Simple One - 915 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: #320 / 609
  • Number of attempts: 1
Increment, increment, increment.... - 567 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #229 / 370
  • Number of attempts: 1
The Cake is a Lie - 1197 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #142 / 487
  • Number of attempts: 3
Simple text editing with Vim - 11624 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1252 / 3410
  • Number of attempts: 2
Vito
Twitter:

The digital era is just a bunch of 0's and 1's

entered into 27 challenges

contributed 0 challenges