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

One number per line - 18712 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2345 / 3859
  • Number of attempts: 2
vim = 22 / 7 - 475 entries

pi square vim

  • Best score: 20
  • Best player score: 38
  • Position: #121 / 135
  • Number of attempts: 1
V to the i - 4799 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1198 / 1892
  • Number of attempts: 1
Add semicolons - 10848 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 16
  • Position: #2441 / 3061
  • Number of attempts: 1
Box it - 7902 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 32
  • Position: #1498 / 1874
  • Number of attempts: 1
Every other line - 2910 entries

AaAaAaA

  • Best score: 12
  • Best player score: 21
  • Position: #624 / 703
  • Number of attempts: 1
Search and Replace 0 - 4978 entries

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

  • Best score: 12
  • Best player score: 18
  • Position: #1324 / 1621
  • Number of attempts: 1
Just the middle - 11446 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2279 / 4194
  • Number of attempts: 4
Extended Customer 2 - 49 entries

Format the chars

  • Best score: 47
  • Best player score: 87
  • Position: #18 / 21
  • Number of attempts: 3
Fiddle percentages into real numbers - 865 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
  • Position: #207 / 291
  • Number of attempts: 1
7th Birthday - 202 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
  • Position: #68 / 75
  • Number of attempts: 1
Swap assigned value - 643 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 15
  • Position: #234 / 253
  • Number of attempts: 1
Change your calendar - 392 entries

Happy New Year!

  • Best score: 18
  • Best player score: 40
  • Position: #73 / 87
  • Number of attempts: 1
I forgot quotes - 15977 entries

Oops.

  • Best score: 10
  • Best player score: 19
  • Position: #3465 / 4177
  • Number of attempts: 3
Sort the VimGolf challenges by popularity - 348 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
  • Position: #93 / 107
  • Number of attempts: 2
Parsing with CSV: Unify lines and result. - 179 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
  • Position: #46 / 77
  • Number of attempts: 1
Fibonacci Triangles - 59 entries

Triangles

  • Best score: 40
  • Best player score: 55
  • Position: #14 / 22
  • Number of attempts: 2
Word frequency alignment - 290 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
  • Position: #7 / 161
  • Number of attempts: 1
Minimalist Limerick - 520 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 34
  • Position: #54 / 174
  • Number of attempts: 5
Coordinates placeholder - 73 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 26
  • Position: #23 / 38
  • Number of attempts: 1
Define to require - 127 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
  • Position: #39 / 50
  • Number of attempts: 1
Enumerate words - 254 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 28
  • Position: #71 / 91
  • Number of attempts: 1
Harder than "abcd > a b c d" - 93 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
  • Position: #42 / 42
  • Number of attempts: 1
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: 255
  • Position: #23 / 26
  • Number of attempts: 1
Circle in a square - 152 entries

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

  • Best score: 23
  • Best player score: 98
  • Position: #51 / 54
  • Number of attempts: 1
Block Fun 1 - 210 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 52
  • Position: #74 / 75
  • Number of attempts: 1
Prefixes and suffixes - 629 entries

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

  • Best score: 17
  • Best player score: 32
  • Position: #162 / 196
  • Number of attempts: 3
Refactor arguments into object argument - 166 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 99
  • Position: #63 / 68
  • Number of attempts: 1
Sort by sum of numbers in a line(?) - 67 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
  • Position: #25 / 39
  • Number of attempts: 1
abcd > a b c d - 291 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 18
  • Position: #216 / 222
  • Number of attempts: 1
Checkerboard case pattern - 164 entries

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

  • Best score: 15
  • Best player score: 30
  • Position: #60 / 61
  • Number of attempts: 2
NATO phonetic alphabet - 526 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 34
  • Position: #190 / 195
  • Number of attempts: 1
A simple change - 461 entries

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

  • Best score: 12
  • Best player score: 28
  • Position: #185 / 191
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 193 entries

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

  • Best score: 24
  • Best player score: 31
  • Position: #99 / 106
  • Number of attempts: 1
The name of the game - 665 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #79 / 360
  • Number of attempts: 1
lamb had a little Mary - 599 entries

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

  • Best score: 16
  • Best player score: 51
  • Position: #159 / 166
  • Number of attempts: 2
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: 45
  • Position: #462 / 480
  • Number of attempts: 1
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 16
  • Position: #435 / 445
  • Number of attempts: 1
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 17
  • Position: #138 / 199
  • Number of attempts: 1
The meaning - 575 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 6
  • Position: #336 / 363
  • Number of attempts: 2
A Simple One - 1047 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
  • Position: #295 / 662
  • Number of attempts: 1
Remember FizzBuzz? - 713 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 209
  • Position: #185 / 188
  • Number of attempts: 1
Sort and add attributes - 1436 entries

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

  • Best score: 33
  • Best player score: 38
  • Position: #476 / 559
  • Number of attempts: 1
Reconstruct the Sentence - 1487 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
  • Position: #364 / 409
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3614 entries

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

  • Best score: 16
  • Best player score: 33
  • Position: #603 / 780
  • Number of attempts: 1
Simple text editing with Vim - 12744 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2167 / 3681
  • Number of attempts: 1

Contributed Challenges

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.

7th Birthday - 202 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. My apologies for poor english.

entered into 46 challenges

contributed 2 challenges