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

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

  • Best score: 10
  • Best player score: 11
  • Position: #91 / 525
  • Number of attempts: 3
Wikitext headings to markdown - 980 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 21
  • Position: #53 / 203
  • Number of attempts: 7
hello-world-vimgolf - 2361 entries

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 18
  • Position: #83 / 257
  • Number of attempts: 3
Reordering Lorem Ipsum - 261 entries

Who even sorted this?

  • Best score: 13
  • Best player score: 13
  • Position: #9 / 61
  • Number of attempts: 4
Fill in the chess board - 905 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 / 175
  • Number of attempts: 7
V to the i - 4751 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1480 / 1879
  • Number of attempts: 1
Search and Replace 0 - 4792 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #856 / 1585
  • Number of attempts: 1
Learn some german verbs - 531 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 / 131
  • Number of attempts: 6
Interweave two blocks of text - 631 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 / 211
  • Number of attempts: 4
Python Hello World! Reformatting - 938 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: #185 / 364
  • Number of attempts: 1
Swap assigned value - 626 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #190 / 250
  • Number of attempts: 2
vim1001 - 275 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: #41 / 107
  • Number of attempts: 4
-a-b-c- - 3176 entries

Put hyphens everywhere.

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

Right AND down.

  • Best score: 13
  • Best player score: 13
  • Position: #56 / 351
  • Number of attempts: 7
Suffix sort - 254 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 / 65
  • Number of attempts: 9
Lisp Condense - 438 entries

Reduce 4 cons selection operations down to one function call.

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

Rotate that triangle.

  • Best score: 14
  • Best player score: 14
  • Position: #35 / 143
  • Number of attempts: 14
Comparing scores - 94 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: #12 / 33
  • Number of attempts: 5
Don't know what this is - 1978 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 / 578
  • Number of attempts: 5
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: 15
  • Position: #34 / 105
  • Number of attempts: 6
Number an outline - 249 entries

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

  • Best score: 25
  • Best player score: 40
  • Position: #28 / 75
  • Number of attempts: 3
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1159 / 3946
  • Number of attempts: 1
Word frequency alignment - 274 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 / 157
  • Number of attempts: 2
Enumerate words - 250 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 23
  • Position: #6 / 89
  • Number of attempts: 4
Groups magic - 153 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: #66 / 91
  • 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: 15
  • Position: #188 / 218
  • Number of attempts: 1
Readable Rubyhash - 244 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 / 92
  • Number of attempts: 4
NATO phonetic alphabet - 501 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 19
  • Position: #45 / 191
  • Number of attempts: 2
Create a pandoc compatible table - 182 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 / 53
  • Number of attempts: 12
Shuffle and Sort - 209 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 / 65
  • Number of attempts: 11
A simple change - 442 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #126 / 189
  • Number of attempts: 3
The Quick Brown Fox Jumps Over The Lazy Vim - 401 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: #96 / 188
  • Number of attempts: 4
The name of the game - 650 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #264 / 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: 16
  • Position: #24 / 163
  • Number of attempts: 8
SFD-ROC: vimvimvim - 1581 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 / 439
  • Number of attempts: 5
Stairs Indenting - 448 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 12
  • Position: #21 / 193
  • Number of attempts: 5
Unwrap the text of an email message - 185 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: #36 / 72
  • Number of attempts: 4
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: 20
  • Position: #70 / 473
  • Number of attempts: 5
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #329 / 441
  • Number of attempts: 3
Inconsistent real estate paste - 184 entries

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

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

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

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

How to switch two arguments of a function.

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

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #252 / 403
  • 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: 14
  • Position: #65 / 194
  • Number of attempts: 5
Remove noise from HTTP log - 695 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 / 270
  • Number of attempts: 1
Remove semicolons after expressions - 628 entries

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

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

how fast can you switch two variable ?

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

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

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

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

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

Create a multiplication table.

  • Best score: 31
  • Best player score: 101
  • Position: #52 / 63
  • Number of attempts: 3
Sort the cardinal numbers - 293 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 13
  • Position: #67 / 146
  • Number of attempts: 2
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Position: #309 / 640
  • Number of attempts: 1
Line Zipper - 450 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 12
  • Position: #15 / 210
  • Number of attempts: 6
remove dupes from array - 1336 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 / 331
  • Number of attempts: 13
PHP Array Syntax -> MailChimp Merge Syntax - 507 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 / 148
  • Number of attempts: 13
Case preserving word replacement - 453 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: #80 / 179
  • Number of attempts: 8
Sort entries based on date - 363 entries

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

  • Best score: 11
  • Best player score: 12
  • Position: #64 / 114
  • Number of attempts: 1
imports alignment (python) - 661 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Position: #47 / 194
  • Number of attempts: 12
Reformat long lines - 341 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 / 130
  • Number of attempts: 1
Generate English Alphabets - 473 entries

Start with a, get up to z.

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

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

  • Best score: 22
  • Best player score: 23
  • Position: #40 / 143
  • Number of attempts: 3
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #69 / 639
  • Number of attempts: 1
Ruby 1.9 hashes - 1221 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: #183 / 401
  • Number of attempts: 1
Assignment Alignment - 832 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 18
  • Position: #55 / 215
  • Number of attempts: 3
Shebangs for all - 1912 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 / 500
  • Number of attempts: 4
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: #530 / 643
  • Number of attempts: 1
Table Reshuffle - 371 entries

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

  • Best score: 22
  • Best player score: 23
  • Position: #26 / 134
  • Number of attempts: 5
Reverse and count - 456 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 / 172
  • Number of attempts: 2
Reverse Simple Deletion - 832 entries

You did the simple deletion, now reverse it.

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

Order the paragraphs correctly, per prefixed index

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

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

  • Best score: 21
  • Best player score: 21
  • Position: #9 / 168
  • Number of attempts: 6
Hatsuyume - 457 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #13 / 175
  • Number of attempts: 1
The Cake is a Lie - 1286 entries

Correct the capitalization of each word

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

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 19
  • Position: #176 / 233
  • Number of attempts: 1
Make Fancy Header - 1014 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 17
  • Position: #206 / 338
  • Number of attempts: 3
Reverse characters in a line - 709 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: #80 / 249
  • Number of attempts: 2
Reformat most common surnames - 647 entries

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

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

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #296 / 558
  • Number of attempts: 2
Sort and add attributes - 1327 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #239 / 529
  • Number of attempts: 2
Reconstruct the Sentence - 1369 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: #229 / 384
  • Number of attempts: 4
blabla zincou
Twitter:

Je ne suis pas spécial :-(

entered into 81 challenges

contributed 0 challenges