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: 255
  • Number of attempts: 1
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: 98
  • Number of attempts: 1
Remember FizzBuzz? - 513 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 209
  • Number of attempts: 1
Extended Customer 2 - 39 entries

Format the chars

  • Best score: 47
  • Best player score: 87
  • Number of attempts: 3
Fibonacci Triangles - 40 entries

Triangles

  • Best score: 40
  • Best player score: 55
  • Number of attempts: 2
Harder than "abcd > a b c d" - 64 entries

Not as easy as the last challenge. This time, just one space between a and b, up to 25 spaces between y and z. (Removed some lines; diff was too long.)

  • Best score: 15
  • Best player score: 146
  • Number of attempts: 1
lamb had a little Mary - 450 entries

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

  • Best score: 16
  • Best player score: 51
  • Number of attempts: 2
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: 104
  • Number of attempts: 1
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: 45
  • Number of attempts: 1
Change your calendar - 217 entries

Happy New Year!

  • Best score: 18
  • Best player score: 40
  • Number of attempts: 1
vim = 22 / 7 - 392 entries

pi square vim

  • Best score: 20
  • Best player score: 38
  • Number of attempts: 1
Sort and add attributes - 1052 entries

Sort the states and add the attribute country to each record.

  • Best score: 18
  • Best player score: 38
  • Number of attempts: 1
Minimalist Limerick - 442 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 34
  • Number of attempts: 5
Whitespace, empty lines and tabs - 2508 entries

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

  • Best score: 16
  • Best player score: 33
  • Number of attempts: 1
Prefixes and suffixes - 465 entries

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

  • Best score: 17
  • Best player score: 32
  • Number of attempts: 3
Enumerate words - 219 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 28
  • Number of attempts: 1
Let's play some Ivmgolf - 864 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 16
  • Number of attempts: 1
A Simple One - 820 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
I forgot quotes - 10181 entries

Oops.

  • Best score: 10
  • Best player score: 19
  • Number of attempts: 3
Parsing with CSV: Unify lines and result. - 162 entries

col1;col2;col3;col4 A;1;4;5 A;3;4; A;1;4; # New output: col1;col2;col3;col4 A;1(2x);3;4(3x);5 any ideas?

  • Best score: 21
  • Best player score: 23
  • Number of attempts: 1
Reconstruct the Sentence - 1004 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 20
  • Best player score: 27
  • Number of attempts: 1
Checkerboard case pattern - 106 entries

All the squares are white. Make some of them black. But only the right ones.

  • Best score: 15
  • Best player score: 30
  • Number of attempts: 2
Swap assigned value - 483 entries

Simple problem but looking for interesting solutions.

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

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

  • Best score: 12
  • Best player score: 18
  • Number of attempts: 1
The name of the game - 574 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Refactor arguments into object argument - 156 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 99
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 140 entries

Someone has vandalized our text (again). Please fix to read: The Quick Brown Fox Jumps Over The Lazy Dog.

  • Best score: 25
  • Best player score: 31
  • Number of attempts: 1
Simple text editing with Vim - 9933 entries

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

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 1
Block Fun 1 - 158 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 52
  • Number of attempts: 1
V to the i - 3564 entries

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

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 1
The meaning - 488 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 6
  • Number of attempts: 2
Sort by sum of numbers in a line(?) - 45 entries

The lines with the biggest sums need to be at the top. The sums are on the right, which makes life hard. Maybe you can find a feature that will do all the work for you...

  • Best score: 15
  • Best player score: 16
  • Number of attempts: 1
Sort the VimGolf challenges by popularity - 241 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: 21
  • Number of attempts: 2
Word frequency alignment - 195 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
NATO phonetic alphabet - 382 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 34
  • Number of attempts: 1
One number per line - 10523 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Number of attempts: 2
7th Birthday - 149 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

  • Best score: 19
  • Best player score: 29
  • Number of attempts: 1
A simple change - 351 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 28
  • Number of attempts: 1
Just the middle - 8496 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 4
Reverse and double space - 402 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 17
  • Number of attempts: 1
Fiddle percentages into real numbers - 668 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 1
abcd > a b c d - 237 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 18
  • Number of attempts: 1
Every other line - 1806 entries

AaAaAaA

  • Best score: 12
  • Best player score: 21
  • Number of attempts: 1
Coordinates placeholder - 49 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 26
  • Number of attempts: 1

Contributed Challenges

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.

7th Birthday - 149 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

Pradeep Kumar
Twitter:

To learn संस्कृत, वेद and the art of programming is my only goal.

entered into 44 challenges

contributed 2 challenges