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

Define to require - 113 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
  • Number of attempts: 7
Minimalist Limerick - 448 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 33
  • Number of attempts: 5
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
  • Number of attempts: 6
Across-Down Flip - 42 entries

Do this instead of the Sunday crossword.

  • Best score: 24
  • Best player score: 26
  • Number of attempts: 2
Increment, increment, increment.... - 481 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
Mess in revision history - 950 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 17
  • Number of attempts: 6
switch variable - 4251 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 11
  • Number of attempts: 4
Words in parens - 10853 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 3
A Simple One - 832 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
  • Number of attempts: 1
Refactor arguments into object argument - 156 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 56
  • Number of attempts: 1
Simple text editing with Vim - 10282 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 2
The Cake is a Lie - 1111 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 3
Wrap the text of an email message to 79 characters - 482 entries

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

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 2
Extract argument from function - 1987 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 4
Word frequency alignment - 197 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
  • Number of attempts: 1
The meaning - 495 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
quotes inside quotes - 2726 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: 2
  • Best player score: 15
  • Number of attempts: 3
Sort the VimGolf challenges by popularity - 257 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
  • Number of attempts: 3
Where should I put the Newline? - 788 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Prefixes and suffixes - 485 entries

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

  • Best score: 17
  • Best player score: 23
  • Number of attempts: 5
Shuffle puzzle - 289 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
  • Number of attempts: 8
Sort the cardinal numbers - 213 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 2
REDRUM - 131 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
  • Number of attempts: 2
Do you demand a shrubbery? - 1001 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 18
  • Number of attempts: 4
attr_aligner - 2957 entries

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

  • Best score: 19
  • Best player score: 19
  • Number of attempts: 13
Vim tetris - 338 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 21
  • Number of attempts: 6
Vertical Limit - 2099 entries

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

  • Best score: 21
  • Best player score: 22
  • Number of attempts: 7
Vito
Twitter:

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

entered into 27 challenges

contributed 0 challenges