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 - 18616 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2336 / 3842
  • Number of attempts: 2
vim = 22 / 7 - 447 entries

pi square vim

  • Best score: 20
  • Best player score: 38
  • Position: #117 / 131
  • Number of attempts: 1
V to the i - 4751 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1194 / 1879
  • Number of attempts: 1
Add semicolons - 10792 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 16
  • Position: #2427 / 3044
  • Number of attempts: 1
Box it - 7827 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 32
  • Position: #1489 / 1864
  • Number of attempts: 1
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 21
  • Position: #622 / 700
  • Number of attempts: 1
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 18
  • Position: #1292 / 1585
  • Number of attempts: 1
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2275 / 4164
  • Number of attempts: 4
Extended Customer 2 - 47 entries

Format the chars

  • Best score: 47
  • Best player score: 87
  • Position: #17 / 20
  • Number of attempts: 3
Fiddle percentages into real numbers - 840 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: #204 / 287
  • Number of attempts: 1
7th Birthday - 186 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: #66 / 73
  • Number of attempts: 1
Swap assigned value - 624 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 15
  • Position: #231 / 249
  • Number of attempts: 1
Change your calendar - 362 entries

Happy New Year!

  • Best score: 18
  • Best player score: 40
  • Position: #71 / 85
  • Number of attempts: 1
I forgot quotes - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 19
  • Position: #3454 / 4161
  • Number of attempts: 3
Sort the VimGolf challenges by popularity - 345 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: #92 / 105
  • Number of attempts: 2
Parsing with CSV: Unify lines and result. - 165 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: #44 / 73
  • Number of attempts: 1
Fibonacci Triangles - 49 entries

Triangles

  • Best score: 40
  • Best player score: 55
  • Position: #12 / 20
  • Number of attempts: 2
Word frequency alignment - 273 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 / 156
  • Number of attempts: 1
Minimalist Limerick - 516 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 34
  • Position: #53 / 171
  • Number of attempts: 5
Coordinates placeholder - 62 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 26
  • Position: #21 / 36
  • Number of attempts: 1
Define to require - 118 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: #38 / 48
  • Number of attempts: 1
Enumerate words - 250 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 28
  • Position: #70 / 89
  • Number of attempts: 1
Harder than "abcd > a b c d" - 77 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: #40 / 40
  • Number of attempts: 1
Chinese Multiplication Table - 77 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: #22 / 24
  • Number of attempts: 1
Circle in a square - 140 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: #49 / 52
  • Number of attempts: 1
Block Fun 1 - 189 entries

Manipulate the columns to produce desired result.

  • Best score: 14
  • Best player score: 52
  • Position: #72 / 73
  • Number of attempts: 1
Prefixes and suffixes - 591 entries

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

  • Best score: 17
  • Best player score: 32
  • Position: #160 / 192
  • Number of attempts: 3
Refactor arguments into object argument - 161 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 99
  • Position: #61 / 65
  • Number of attempts: 1
Sort by sum of numbers in a line(?) - 58 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: #23 / 36
  • Number of attempts: 1
abcd > a b c d - 280 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 18
  • Position: #212 / 218
  • Number of attempts: 1
Checkerboard case pattern - 148 entries

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

  • Best score: 15
  • Best player score: 30
  • Position: #57 / 58
  • Number of attempts: 2
NATO phonetic alphabet - 501 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 34
  • Position: #186 / 191
  • Number of attempts: 1
A simple change - 442 entries

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

  • Best score: 12
  • Best player score: 28
  • Position: #183 / 189
  • Number of attempts: 1
SFD-ROC: The Quick Brown Fox - 169 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: #95 / 101
  • Number of attempts: 1
The name of the game - 650 entries

End up with the name of the game.

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

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

  • Best score: 16
  • Best player score: 51
  • Position: #157 / 163
  • Number of attempts: 2
Saving the hashes(#) - 1992 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: #455 / 473
  • Number of attempts: 1
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 16
  • Position: #431 / 441
  • Number of attempts: 1
Reverse and double space - 489 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 17
  • Position: #136 / 194
  • Number of attempts: 1
The meaning - 558 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 6
  • Position: #330 / 356
  • Number of attempts: 2
A Simple One - 1001 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 / 643
  • Number of attempts: 1
Remember FizzBuzz? - 654 entries

Output FizzBuzz to 100. Start with nothing.

  • Best score: 39
  • Best player score: 209
  • Position: #174 / 177
  • Number of attempts: 1
Sort and add attributes - 1327 entries

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

  • Best score: 33
  • Best player score: 38
  • Position: #449 / 529
  • Number of attempts: 1
Reconstruct the Sentence - 1363 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: #344 / 383
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3339 entries

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

  • Best score: 16
  • Best player score: 33
  • Position: #569 / 736
  • Number of attempts: 1
Simple text editing with Vim - 12281 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2097 / 3580
  • Number of attempts: 1

Contributed Challenges

Saving the hashes(#) - 1992 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 - 186 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