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 - 33385 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: 26
  • Position: #3404 / 7364
  • Number of attempts: 1
V to the i - 4751 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #839 / 1879
  • Number of attempts: 1
Extract argument from function - 2314 entries

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

  • Best score: 13
  • Best player score: 19
  • Position: #664 / 744
  • Number of attempts: 1
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #792 / 1585
  • Number of attempts: 3
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1792 / 4164
  • Number of attempts: 1
JSON string rotation - 55 entries

Right value strings are misplaced. Just rotate them! I'm too kind with you guys and didn't included "strings with \" in it"!

  • Best score: 19
  • Best player score: 42
  • Position: #19 / 19
  • Number of attempts: 1
readability - 312 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 19
  • Position: #96 / 148
  • Number of attempts: 3
vim1001 - 275 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

  • Best score: 17
  • Best player score: 42
  • Position: #102 / 107
  • Number of attempts: 1
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 16
  • Position: #758 / 1129
  • Number of attempts: 1
Count both ways - 1001 entries

Right AND down.

  • Best score: 13
  • Best player score: 19
  • Position: #324 / 351
  • Number of attempts: 1
NBCU Weekly Challenge - Test - 243 entries

Just testing.

  • Best score: 18
  • Best player score: 21
  • Position: #101 / 114
  • Number of attempts: 2
Change name of a variable - 169 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

  • Best score: 9
  • Best player score: 9
  • Position: #64 / 132
  • Number of attempts: 2
Lisp Condense - 438 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 17
  • Position: #120 / 154
  • Number of attempts: 3
120 Degrees - 468 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 29
  • Position: #129 / 143
  • Number of attempts: 3
NBCU Weekly Challenge - #0 - 125 entries

One of our favorites lines here at NBCU! p.s. The first version of #0 was deleted due to me copy/pasting a HTML entity. Congrats to the one who figured that out, you are a true ninja warrior!

  • Best score: 30
  • Best player score: 35
  • Position: #43 / 56
  • Number of attempts: 3
Comparing scores - 94 entries

If Alice and Bob both did the challenge, put their entries together in the top paragraph, so we can compare their scores more easily.

  • Best score: 18
  • Best player score: 45
  • Position: #26 / 33
  • Number of attempts: 3
Do you demand a shrubbery? - 1120 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 32
  • Position: #245 / 293
  • Number of attempts: 1
Don't know what this is - 1978 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 16
  • Position: #445 / 578
  • Number of attempts: 2
Two become one - 710 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 37
  • Position: #170 / 205
  • Number of attempts: 2
Where should I put the Newline? - 863 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #301 / 431
  • Number of attempts: 1
Shuffle puzzle - 317 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: #59 / 101
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 16
  • Position: #3233 / 3666
  • Number of attempts: 1
Letter case trickery - 1594 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 17
  • Position: #467 / 511
  • Number of attempts: 2
Sort the VimGolf challenges by popularity - 345 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: 17
  • Position: #66 / 105
  • Number of attempts: 3
Hole-in-one - 1012 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 21
  • Position: #214 / 302
  • Number of attempts: 1
Delete unwanted lines - 396 entries

Delete all lines which does not end in "o.."

  • Best score: 9
  • Best player score: 12
  • Position: #217 / 225
  • Number of attempts: 1
Circle in a square - 140 entries

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

  • Best score: 23
  • Best player score: 76
  • Position: #45 / 52
  • Number of attempts: 4
Vertical Limit - 2437 entries

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

  • Best score: 21
  • Best player score: 30
  • Position: #646 / 736
  • Number of attempts: 1
replacing each line of a block selection - 2946 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #378 / 767
  • Number of attempts: 1
switch variable - 5031 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1358 / 1735
  • Number of attempts: 2
Simple text editing with Vim - 12281 entries

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

  • Best score: 13
  • Best player score: 20
  • Position: #2707 / 3580
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 6557 entries

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

  • Best score: 32
  • Best player score: 38
  • Position: #614 / 1614
  • Number of attempts: 3

Contributed Challenges

Refactor static member invocation - 198 entries

Someone used a static method. Refactor the method into a static import while fixing the assertion.

AC
Twitter:

entered into 32 challenges

contributed 1 challenges