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

Put a newline after every 10 lines in vim - 1649 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 11
  • Position: #96 / 551
  • Number of attempts: 3
Wikitext headings to markdown - 985 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 21
  • Position: #54 / 207
  • Number of attempts: 7
hello-world-vimgolf - 2472 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #142 / 699
  • Number of attempts: 4
Contribute to keyboard mashing - 880 entries

Speak in tongues

  • Best score: 17
  • Best player score: 18
  • Position: #87 / 268
  • Number of attempts: 3
Reordering Lorem Ipsum - 265 entries

Who even sorted this?

  • Best score: 13
  • Best player score: 13
  • Position: #9 / 64
  • Number of attempts: 4
Fill in the chess board - 933 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 19
  • Position: #13 / 180
  • Number of attempts: 7
V to the i - 4771 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1482 / 1887
  • Number of attempts: 1
Search and Replace 0 - 4851 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #867 / 1604
  • Number of attempts: 1
Learn some german verbs - 532 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 21
  • Position: #52 / 132
  • Number of attempts: 6
Interweave two blocks of text - 641 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

  • Best score: 15
  • Best player score: 15
  • Position: #25 / 212
  • Number of attempts: 4
Python Hello World! Reformatting - 955 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 43
  • Position: #187 / 371
  • Number of attempts: 1
Swap assigned value - 628 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #191 / 252
  • Number of attempts: 2
vim1001 - 284 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

  • Best score: 17
  • Best player score: 21
  • Position: #42 / 108
  • Number of attempts: 4
-a-b-c- - 3183 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #425 / 1132
  • Number of attempts: 2
Count both ways - 1006 entries

Right AND down.

  • Best score: 13
  • Best player score: 13
  • Position: #56 / 352
  • Number of attempts: 7
Suffix sort - 255 entries

Sort from the end of the line, as if the letters in each line were reversed.

  • Best score: 19
  • Best player score: 19
  • Position: #6 / 66
  • Number of attempts: 9
Lisp Condense - 449 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 13
  • Position: #56 / 157
  • Number of attempts: 4
120 Degrees - 469 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 14
  • Position: #35 / 144
  • Number of attempts: 14
Comparing scores - 95 entries

If Alice and Bob both did the challenge, put their entries together in the top paragraph, so we can compare their scores more easily.

  • Best score: 18
  • Best player score: 21
  • Position: #13 / 34
  • Number of attempts: 5
Don't know what this is - 1996 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 11
  • Position: #130 / 581
  • Number of attempts: 5
Sort the VimGolf challenges by popularity - 346 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: 15
  • Position: #34 / 106
  • Number of attempts: 6
Number an outline - 252 entries

The indent and words are right, but the numbers are all wrong.

  • Best score: 25
  • Best player score: 40
  • Position: #29 / 76
  • Number of attempts: 3
Words in parens - 12868 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1160 / 3950
  • Number of attempts: 1
Word frequency alignment - 278 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: #110 / 159
  • Number of attempts: 2
Enumerate words - 251 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 23
  • Position: #6 / 90
  • Number of attempts: 4
Groups magic - 157 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 14
  • Position: #67 / 92
  • Number of attempts: 1
abcd > a b c d - 282 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #188 / 220
  • Number of attempts: 1
Readable Rubyhash - 245 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 23
  • Best player score: 23
  • Position: #4 / 93
  • Number of attempts: 4
NATO phonetic alphabet - 506 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 19
  • Position: #45 / 194
  • Number of attempts: 2
Create a pandoc compatible table - 185 entries

In [this vimcast][1], a featured gist from Tim Pope shows how to quickly make a simple table structure. How fast can you convert it to pandoc's markdown style? [1]: http://vimcasts.org/episodes/aligning-text-with-tabular-vim/

  • Best score: 32
  • Best player score: 32
  • Position: #11 / 55
  • Number of attempts: 12
Shuffle and Sort - 210 entries

The values where sorted incorrectly. Get them back to how they are supposed to be

  • Best score: 17
  • Best player score: 17
  • Position: #11 / 66
  • Number of attempts: 11
A simple change - 444 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #127 / 190
  • Number of attempts: 3
The Quick Brown Fox Jumps Over The Lazy Vim - 404 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 10
  • Position: #97 / 190
  • Number of attempts: 4
The name of the game - 654 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #264 / 359
  • Number of attempts: 1
lamb had a little Mary - 596 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #24 / 164
  • Number of attempts: 8
SFD-ROC: vimvimvim - 1594 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 8
  • Position: #121 / 443
  • Number of attempts: 5
Stairs Indenting - 452 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 12
  • Position: #21 / 195
  • Number of attempts: 5
Unwrap the text of an email message - 188 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 17
  • Position: #37 / 73
  • Number of attempts: 4
Saving the hashes(#) - 2008 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: 20
  • Position: #70 / 476
  • Number of attempts: 5
Let's play some Ivmgolf - 1096 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #330 / 442
  • Number of attempts: 3
Inconsistent real estate paste - 185 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

  • Best score: 24
  • Best player score: 24
  • Position: #10 / 56
  • Number of attempts: 7
Vertical Limit - 2487 entries

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

  • Best score: 21
  • Best player score: 21
  • Position: #96 / 748
  • Number of attempts: 5
Switch function arguments - 2085 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #323 / 653
  • Number of attempts: 1
Append semicolon after expressions - 1023 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #256 / 410
  • Number of attempts: 1
Reverse and double space - 498 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Position: #65 / 197
  • Number of attempts: 5
Remove noise from HTTP log - 700 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Position: #138 / 272
  • Number of attempts: 1
Remove semicolons after expressions - 639 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Position: #118 / 261
  • Number of attempts: 3
switch variable - 5045 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #649 / 1742
  • Number of attempts: 2
Calculate the table totals - 133 entries

Go ahead... commit the treachery of using vim as a spreadsheet.

  • Best score: 33
  • Best player score: 33
  • Position: #9 / 44
  • Number of attempts: 9
Ugly spreadsheet copy/paste to CSV - 978 entries

convert an ugly spreadsheet copy/paste into a CSV format.

  • Best score: 19
  • Best player score: 19
  • Position: #10 / 188
  • Number of attempts: 18
Multiplication table. - 206 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 101
  • Position: #53 / 64
  • Number of attempts: 3
Sort the cardinal numbers - 294 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 13
  • Position: #68 / 147
  • Number of attempts: 2
Make it more readable - 1955 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Position: #310 / 643
  • Number of attempts: 1
Line Zipper - 454 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 12
  • Position: #15 / 212
  • Number of attempts: 6
remove dupes from array - 1345 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 17
  • Position: #82 / 333
  • Number of attempts: 13
PHP Array Syntax -> MailChimp Merge Syntax - 508 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

  • Best score: 23
  • Best player score: 23
  • Position: #25 / 149
  • Number of attempts: 13
Case preserving word replacement - 454 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

  • Best score: 19
  • Best player score: 20
  • Position: #81 / 180
  • Number of attempts: 8
Sort entries based on date - 364 entries

Sort some entries in a Ledger-file based on date.

  • Best score: 11
  • Best player score: 12
  • Position: #65 / 115
  • Number of attempts: 1
imports alignment (python) - 663 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Position: #47 / 196
  • Number of attempts: 12
Reformat long lines - 346 entries

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

  • Best score: 15
  • Best player score: 15
  • Position: #27 / 133
  • Number of attempts: 1
Generate English Alphabets - 476 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 23
  • Position: #23 / 205
  • Number of attempts: 4
Insert a Markdown link - 434 entries

Put a link in a markdown document, using the after-the-paragraph format.

  • Best score: 22
  • Best player score: 23
  • Position: #41 / 145
  • Number of attempts: 3
Numbering a List - 1869 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #69 / 646
  • Number of attempts: 1
Ruby 1.9 hashes - 1225 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 13
  • Position: #184 / 402
  • Number of attempts: 1
Assignment Alignment - 842 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 18
  • Position: #55 / 217
  • Number of attempts: 3
Shebangs for all - 1917 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 11
  • Position: #64 / 502
  • Number of attempts: 4
A Simple One - 1009 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: #530 / 648
  • Number of attempts: 1
Table Reshuffle - 372 entries

Fix the column order in this table... also append the new 'username' column.

  • Best score: 22
  • Best player score: 23
  • Position: #26 / 135
  • Number of attempts: 5
Reverse and count - 459 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 18
  • Position: #9 / 174
  • Number of attempts: 2
Reverse Simple Deletion - 834 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 11
  • Position: #48 / 455
  • Number of attempts: 2
Sorting paragraphs - 510 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 18
  • Position: #10 / 159
  • Number of attempts: 4
Indentation - 499 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 20
  • Best player score: 21
  • Position: #10 / 170
  • Number of attempts: 6
Hatsuyume - 467 entries

http://en.wikipedia.org/wiki/Hatsuyume

  • Best score: 15
  • Best player score: 17
  • Position: #15 / 179
  • Number of attempts: 1
The Cake is a Lie - 1301 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #262 / 517
  • Number of attempts: 4
Context Insensitive completion 1 - 471 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 19
  • Position: #180 / 237
  • Number of attempts: 1
Make Fancy Header - 1024 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 17
  • Position: #208 / 340
  • Number of attempts: 3
Reverse characters in a line - 732 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 13
  • Position: #82 / 257
  • Number of attempts: 2
Reformat most common surnames - 671 entries

Reformat copy-pasted table into a list of the most common surnames

  • Best score: 23
  • Best player score: 24
  • Position: #23 / 202
  • Number of attempts: 6
Change the content of a string - 1502 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #300 / 567
  • Number of attempts: 2
Sort and add attributes - 1369 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #239 / 542
  • Number of attempts: 2
Reconstruct the Sentence - 1436 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: 21
  • Position: #236 / 397
  • Number of attempts: 4
blabla zincou
Twitter:

Je ne suis pas spécial :-(

entered into 81 challenges

contributed 0 challenges