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 - 33614 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: 25
  • Position: #3127 / 7418
  • Number of attempts: 3
Prime Numbers - 354 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 81
  • Position: #71 / 104
  • Number of attempts: 2
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #254 / 1893
  • Number of attempts: 3
Search and Replace 0 - 4989 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #262 / 1624
  • Number of attempts: 2
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #81 / 701
  • Number of attempts: 3
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #330 / 4197
  • Number of attempts: 3
Add to end of each line... kinda - 333 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: #18 / 174
  • Number of attempts: 1
Vice versa - 7904 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #25 / 2126
  • Number of attempts: 6
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 7
  • Position: #33 / 269
  • Number of attempts: 2
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #70 / 1190
  • Number of attempts: 2
Shuffled numbers - 246 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

  • Best score: 15
  • Best player score: 16
  • Position: #53 / 96
  • Number of attempts: 3
I forgot quotes - 15980 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #206 / 4179
  • Number of attempts: 3
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #115 / 1137
  • Number of attempts: 3
Do you demand a shrubbery? - 1158 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 18
  • Position: #128 / 300
  • Number of attempts: 2
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #94 / 437
  • Number of attempts: 2
attr_aligner - 3516 entries

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

  • Best score: 19
  • Best player score: 28
  • Position: #306 / 701
  • Number of attempts: 3
Counting in binary - 526 entries

"a" represents 0; "A" represents 1. Start from zero and count to 15.

  • Best score: 16
  • Best player score: 41
  • Position: #82 / 117
  • Number of attempts: 2
Letter case trickery - 1630 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: 11
  • Position: #208 / 518
  • Number of attempts: 2
Words in parens - 12930 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #127 / 3962
  • Number of attempts: 3
Chinese Multiplication Table - 81 entries

Print a Chinese multiplication table in Vim. In China, every kid is asked to memorize this table. And thanks to the mono-syllabism of Chinese characters, it is not that hard. Printing the multiplication table is also a good exercise for programming beginners. For-loop, escaped characters, etc... There should be some special ways to print it in Vim.

  • Best score: 39
  • Best player score: 63
  • Position: #9 / 26
  • Number of attempts: 2
Complete the circuit grid! - 105 entries

Continuing from the last challenge, add additional rows to the grid. Change each of the names from 'A1'...'A10' to 'B1'...'B10', 'C1'...'C10', etc, and for each new row add 0.7 to the X values in the (X Y) at the end of each line.

  • Best score: 46
  • Best player score: 57
  • Position: #12 / 30
  • Number of attempts: 2
lamb had a little Mary - 609 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #13 / 168
  • Number of attempts: 10
Saving the hashes(#) - 2063 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 25
  • Position: #168 / 480
  • Number of attempts: 2
Vertical Limit - 2538 entries

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

  • Best score: 21
  • Best player score: 28
  • Position: #578 / 754
  • Number of attempts: 2
Make the circuit grid! - 101 entries

Copy this command for a circuit layout program to create 10 total smd commands. Increment the number in quotes to name each pad, and add 0.7 to each of the (X Y) coordinates at the end of each line.

  • Best score: 26
  • Best player score: 26
  • Position: #13 / 50
  • Number of attempts: 1
replacing each line of a block selection - 2999 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #370 / 777
  • Number of attempts: 3
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Position: #410 / 663
  • Number of attempts: 1
Line Zipper - 473 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #184 / 215
  • Number of attempts: 3
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 17
  • Position: #96 / 652
  • Number of attempts: 3
Remember FizzBuzz? - 724 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 56
  • Position: #81 / 189
  • Number of attempts: 3
Whitespace, empty lines and tabs - 3647 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 23
  • Position: #345 / 784
  • Number of attempts: 4
I
Twitter:

entered into 31 challenges

contributed 0 challenges