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

Chinese Multiplication Table - 50 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
  • Number of attempts: 2
Complete the circuit grid! - 72 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: 49
  • Best player score: 57
  • Number of attempts: 2
Remember FizzBuzz? - 513 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 56
  • Number of attempts: 3
attr_aligner - 2795 entries

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

  • Best score: 19
  • Best player score: 28
  • Number of attempts: 3
Vertical Limit - 2032 entries

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

  • Best score: 21
  • Best player score: 28
  • Number of attempts: 2
Make the circuit grid! - 71 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
  • Number of attempts: 1
Simple, Practical, and Common - 21286 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: 5
  • Best player score: 25
  • Number of attempts: 3
Prime Numbers - 261 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 81
  • Number of attempts: 2
-a-b-c- - 2369 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
I forgot quotes - 10188 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 3
Vice versa - 5398 entries

Little role switching.

  • Best score: 2
  • Best player score: 12
  • Number of attempts: 6
That hyphen - 1859 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 3
Line Zipper - 388 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 3
Counting in binary - 323 entries

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

  • Best score: 16
  • Best player score: 41
  • Number of attempts: 2
Where should I put the Newline? - 782 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Whitespace, empty lines and tabs - 2508 entries

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

  • Best score: 16
  • Best player score: 23
  • Number of attempts: 4
V to the i - 3566 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Mirror Symmetry - 681 entries

Add backslashes.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Add to end of each line... kinda - 258 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
  • Number of attempts: 1
Collect List - 3168 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Letter case trickery - 1413 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
  • Number of attempts: 2
Just the middle - 8502 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Words in parens - 10379 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 3
Numbering a List - 1699 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 3
lamb had a little Mary - 450 entries

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

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 10
Search and Replace 0 - 3841 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Switch function arguments - 1786 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 1
Shuffled numbers - 195 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
  • Number of attempts: 3
Do you demand a shrubbery? - 985 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 18
  • Number of attempts: 2
replacing each line of a block selection - 2398 entries

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

  • Best score: 17
  • Best player score: 21
  • Number of attempts: 3
Saving the hashes(#) - 1686 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
  • Number of attempts: 2
I
Twitter:

entered into 31 challenges

contributed 0 challenges