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 - 32892 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: 22
  • Position: #416 / 7268
  • Number of attempts: 7
One number per line - 18377 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #13 / 3787
  • Number of attempts: 3
V to the i - 4635 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #285 / 1855
  • Number of attempts: 2
Every other line - 2829 entries

AaAaAaA

  • Best score: 12
  • Best player score: 20
  • Position: #594 / 686
  • Number of attempts: 2
Search and Replace 0 - 4644 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #413 / 1539
  • Number of attempts: 6
Just the middle - 11135 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #445 / 4111
  • Number of attempts: 3
Adam's challenge - 913 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 18
  • Position: #14 / 256
  • Number of attempts: 3
JS notation to Immutable.js notation - 155 entries

Now Immutable.js made its way into many frontends. This challenge consists of a typical refactoring that many of us are facing now.

  • Best score: 35
  • Best player score: 46
  • Position: #48 / 59
  • Number of attempts: 1
Add to end of each line... kinda - 288 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 12
  • Position: #55 / 155
  • Number of attempts: 3
Vice versa - 7512 entries

Little role switching.

  • Best score: 12
  • Best player score: 14
  • Position: #847 / 2039
  • Number of attempts: 4
comments galore - 970 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #45 / 410
  • Number of attempts: 2
Mirrored text - 162 entries

backward and forward, and long enough to be challenging

  • Best score: 14
  • Best player score: 14
  • Position: #18 / 69
  • Number of attempts: 5
Replace and keep the case - 395 entries

Replace all instance of plugin and Plugin to device and Device.

  • Best score: 26
  • Best player score: 27
  • Position: #55 / 111
  • Number of attempts: 4
O Christmas Tree - 99 entries

Design a macro that makes trees grow (or ASCII triangles, if that's too hard).

  • Best score: 22
  • Best player score: 25
  • Position: #6 / 40
  • Number of attempts: 6
From A to B - 552 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Position: #64 / 152
  • Number of attempts: 5
Collect List - 4178 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 15
  • Position: #683 / 1166
  • Number of attempts: 3
VimGolfNight - 491 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #134 / 326
  • Number of attempts: 2
camel riding - 742 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 15
  • Position: #42 / 266
  • Number of attempts: 5
readability - 306 entries

Make the code readable by adding some spaces

  • Best score: 18
  • Best player score: 19
  • Position: #117 / 145
  • Number of attempts: 1
Fill visual area - 77 entries

Just have fun!

  • Best score: 20
  • Best player score: 20
  • Position: #5 / 34
  • Number of attempts: 5
I forgot quotes - 15719 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #274 / 4110
  • Number of attempts: 4
-a-b-c- - 3116 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #124 / 1112
  • Number of attempts: 5
Count both ways - 947 entries

Right AND down.

  • Best score: 13
  • Best player score: 17
  • Position: #293 / 338
  • Number of attempts: 2
Do you demand a shrubbery? - 1103 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 15
  • Position: #39 / 290
  • Number of attempts: 10
Vim tetris - 351 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 23
  • Position: #34 / 100
  • Number of attempts: 3
Split the words - 348 entries

Add the spaces manually if you must, but if you use Vim's spell checking feature wisely, I think you'll save a LARGE number of strokes.

  • Best score: 18
  • Best player score: 36
  • Position: #52 / 105
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 10533 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #815 / 3637
  • Number of attempts: 3
attr_aligner - 3387 entries

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

  • Best score: 19
  • Best player score: 32
  • Position: #448 / 683
  • Number of attempts: 2
Letter case trickery - 1545 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: 12
  • Position: #299 / 498
  • Number of attempts: 2
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: 14
  • Position: #209 / 1044
  • Number of attempts: 5
Assign list - 146 entries

Assign list elements to matrix

  • Best score: 30
  • Best player score: 49
  • Position: #34 / 55
  • Number of attempts: 1
Minimalist Limerick - 503 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 34
  • Position: #64 / 167
  • Number of attempts: 1
abcd > a b c d - 259 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #117 / 203
  • Number of attempts: 2
The name of the game - 622 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #152 / 340
  • Number of attempts: 4
lamb had a little Mary - 550 entries

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

  • Best score: 16
  • Best player score: 32
  • Position: #59 / 156
  • Number of attempts: 6
Stairs Indenting - 412 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 12
  • Position: #9 / 181
  • Number of attempts: 3
Vertical Limit - 2363 entries

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

  • Best score: 21
  • Best player score: 22
  • Position: #147 / 714
  • Number of attempts: 6
replacing each line of a block selection - 2791 entries

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

  • Best score: 18
  • Best player score: 20
  • Position: #244 / 732
  • Number of attempts: 7
Remove noise from HTTP log - 657 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Position: #85 / 259
  • Number of attempts: 4
un-C-escape string - 53 entries

Convert escape sequences to characters

  • Best score: 12
  • Best player score: 12
  • Position: #38 / 47
  • Number of attempts: 1
switch variable - 4903 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #857 / 1699
  • Number of attempts: 4
Shebangs for all - 1771 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: 16
  • Position: #294 / 467
  • Number of attempts: 2
Reverse and count - 408 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 24
  • Position: #61 / 156
  • Number of attempts: 6
The Cake is a Lie - 1190 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #163 / 485
  • Number of attempts: 2
Simple text editing with Vim - 11595 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1118 / 3404
  • Number of attempts: 3
Reformat/Refactor a Golfer Class - 5975 entries

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

  • Best score: 32
  • Best player score: 42
  • Position: #879 / 1476
  • Number of attempts: 2
Domingue Justin
Twitter:

entered into 46 challenges

contributed 0 challenges