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

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

  • Best score: 10
  • Best player score: 11
  • Position: #78 / 401
  • Number of attempts: 3
Wikitext headings to markdown - 709 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 21
  • Position: #36 / 157
  • Number of attempts: 7
hello-world-vimgolf - 1758 entries

Simple number generation

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

Speak in tongues

  • Best score: 17
  • Best player score: 18
  • Position: #75 / 214
  • Number of attempts: 3
Reordering Lorem Ipsum - 210 entries

Who even sorted this?

  • Best score: 13
  • Best player score: 13
  • Position: #9 / 51
  • Number of attempts: 4
Fill in the chess board - 665 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 / 140
  • Number of attempts: 7
V to the i - 4647 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #1469 / 1861
  • Number of attempts: 1
Search and Replace 0 - 4722 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #843 / 1562
  • Number of attempts: 1
Learn some german verbs - 520 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 / 128
  • Number of attempts: 6
Interweave two blocks of text - 613 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 / 208
  • Number of attempts: 4
Python Hello World! Reformatting - 910 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: #182 / 355
  • Number of attempts: 1
Swap assigned value - 567 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #182 / 237
  • Number of attempts: 2
vim1001 - 274 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 / 106
  • Number of attempts: 4
-a-b-c- - 3129 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #422 / 1116
  • Number of attempts: 2
Count both ways - 968 entries

Right AND down.

  • Best score: 13
  • Best player score: 13
  • Position: #56 / 344
  • Number of attempts: 7
Suffix sort - 242 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 / 63
  • Number of attempts: 9
Lisp Condense - 432 entries

Reduce 4 cons selection operations down to one function call.

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

Rotate that triangle.

  • Best score: 14
  • Best player score: 14
  • Position: #35 / 142
  • 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 - 1959 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 / 574
  • Number of attempts: 5
Sort the VimGolf challenges by popularity - 340 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 / 103
  • Number of attempts: 6
Number an outline - 246 entries

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

  • Best score: 25
  • Best player score: 40
  • Position: #27 / 74
  • Number of attempts: 3
Words in parens - 12775 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #1156 / 3926
  • Number of attempts: 1
Word frequency alignment - 256 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 / 150
  • Number of attempts: 2
Enumerate words - 241 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 23
  • Position: #6 / 86
  • Number of attempts: 4
Groups magic - 144 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: #65 / 86
  • Number of attempts: 1
abcd > a b c d - 270 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #188 / 211
  • Number of attempts: 1
Readable Rubyhash - 240 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 / 89
  • Number of attempts: 4
NATO phonetic alphabet - 490 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 19
  • Position: #45 / 185
  • Number of attempts: 2
Create a pandoc compatible table - 177 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 / 51
  • Number of attempts: 12
Shuffle and Sort - 199 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 / 62
  • Number of attempts: 11
A simple change - 429 entries

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

  • Best score: 12
  • Best player score: 14
  • Position: #125 / 184
  • Number of attempts: 3
The Quick Brown Fox Jumps Over The Lazy Vim - 393 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: #95 / 183
  • Number of attempts: 4
The name of the game - 636 entries

End up with the name of the game.

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

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

  • Best score: 16
  • Best player score: 16
  • Position: #24 / 159
  • Number of attempts: 8
SFD-ROC: vimvimvim - 1527 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 / 429
  • Number of attempts: 5
Stairs Indenting - 439 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 12
  • Position: #21 / 188
  • Number of attempts: 5
Unwrap the text of an email message - 178 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 / 70
  • Number of attempts: 4
Saving the hashes(#) - 1973 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 / 468
  • Number of attempts: 5
Let's play some Ivmgolf - 1036 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #323 / 425
  • Number of attempts: 3
Inconsistent real estate paste - 178 entries

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

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

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

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

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #317 / 632
  • Number of attempts: 1
Append semicolon after expressions - 973 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #248 / 393
  • Number of attempts: 1
Reverse and double space - 456 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Position: #65 / 187
  • Number of attempts: 5
Remove noise from HTTP log - 668 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 / 264
  • Number of attempts: 1
Remove semicolons after expressions - 580 entries

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

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

how fast can you switch two variable ?

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

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

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

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

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

Create a multiplication table.

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

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 13
  • Position: #65 / 142
  • Number of attempts: 2
Make it more readable - 1921 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Position: #306 / 631
  • Number of attempts: 1
Line Zipper - 448 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 12
  • Position: #15 / 208
  • Number of attempts: 6
remove dupes from array - 1324 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 / 328
  • Number of attempts: 13
PHP Array Syntax -> MailChimp Merge Syntax - 503 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 / 145
  • Number of attempts: 13
Case preserving word replacement - 442 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 / 177
  • Number of attempts: 8
Sort entries based on date - 357 entries

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

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

Align as one import per line.

  • Best score: 17
  • Best player score: 17
  • Position: #47 / 193
  • Number of attempts: 12
Reformat long lines - 329 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 / 129
  • Number of attempts: 1
Generate English Alphabets - 449 entries

Start with a, get up to z.

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

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

  • Best score: 22
  • Best player score: 23
  • Position: #39 / 142
  • Number of attempts: 3
Numbering a List - 1838 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #69 / 631
  • Number of attempts: 1
Ruby 1.9 hashes - 1177 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: #180 / 387
  • Number of attempts: 1
Assignment Alignment - 823 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 18
  • Position: #55 / 214
  • Number of attempts: 3
Shebangs for all - 1788 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 / 471
  • Number of attempts: 4
A Simple One - 968 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 / 629
  • Number of attempts: 1
Table Reshuffle - 360 entries

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

  • Best score: 22
  • Best player score: 23
  • Position: #26 / 129
  • Number of attempts: 5
Reverse and count - 422 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 / 162
  • Number of attempts: 2
Reverse Simple Deletion - 799 entries

You did the simple deletion, now reverse it.

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

Order the paragraphs correctly, per prefixed index

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

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

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

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

  • Best score: 16
  • Best player score: 17
  • Position: #11 / 170
  • Number of attempts: 1
The Cake is a Lie - 1238 entries

Correct the capitalization of each word

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

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 19
  • Position: #172 / 224
  • Number of attempts: 1
Make Fancy Header - 984 entries

Make the header text stand out with surrounding asterisks

  • Best score: 16
  • Best player score: 17
  • Position: #205 / 332
  • Number of attempts: 3
Reverse characters in a line - 666 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: #78 / 241
  • Number of attempts: 2
Reformat most common surnames - 599 entries

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

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

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #282 / 531
  • Number of attempts: 2
Sort and add attributes - 1226 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #239 / 495
  • Number of attempts: 2
Reconstruct the Sentence - 1195 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: #213 / 352
  • Number of attempts: 4
blabla zincou
Twitter:

Je ne suis pas sp├ęcial :-(

entered into 81 challenges

contributed 0 challenges