Top Entries
Cleanining up 80 column concatenated text - Rank: 1/160, Score: 31
1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation
Hi nok! - Rank: 1/168, Score: 2
Tuberda!
Generate Fibonacci Numbers - Rank: 1/162, Score: 19
Use your super vim powers to generate Fibonacci Numbers.
Rotating Philosophers Problem - Rank: 1/295, Score: 29
Can you help the philosophers find a good place to sit before they get five forks and spaghetti?
Letters are numbers - Rank: 1/92, Score: 20
Letters and numbers are interchangeable. A lot of programming languages give you simple ways to convert individual letters to hex, binary and decimal but does Vim?
Insert a Markdown link - Rank: 1/320, Score: 22
Put a link in a markdown document, using the after-the-paragraph format.
Sort and add attributes - Rank: 1/798, Score: 33
Sort the states and add the attribute country to each record.
Prime Numbers - Rank: 1/185, Score: 34
List the first 100 prime numbers.
replacing each line of a block selection - Rank: 1/852, Score: 18
replace each line's ../assets/js with /javascripts
Shebangs for all - Rank: 2/729, Score: 11
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.
Reverse Simple Deletion - Rank: 2/459, Score: 11
You did the simple deletion, now reverse it.
Append semicolon after expressions - Rank: 2/380, Score: 11
Some lines need the semicolon, some don't.
Solve the Sokoban - Rank: 2/126, Score: 25
A wink for all Vimgolfers that play Nethack too.
Fix the Haiku - Rank: 2/186, Score: 29
Change this slightly scrambled haiku to its unscrambled form and fix the capitalisation and punctuation along the way.
Shuffle and Sort - Rank: 2/123, Score: 17
The values where sorted incorrectly. Get them back to how they are supposed to be
Word Blender - Rank: 3/93, Score: 33
The insides of long words seem to have been run through the blender. Can you fix this famous tale, brave knight?
Make the circuit grid! - Rank: 3/49, Score: 26
Copy this command for a circuit layout program to create 10 total smd commands. Increment the number in quotes to name each pad, and add 0.7 to each of the (X Y) coordinates at the end of each line.
The Universal Declaration of Human Rights, Article 1 - Rank: 3/114, Score: 24
Somebody's got this slightly muddled up. See how quickly you can fix it. (I made this to experiment with buffers. I'm not actually sure whether this is faster with buffers or without.)
82 bottles of beer on the wall - Rank: 3/208, Score: 108
Take them down. (sorry, only 82 bottles because the problem size is limited!)
Braces or Brackets? - Rank: 4/592, Score: 34
Someone forgot whether to use braces or brackets and you have to clean up their code!
Table Reshuffle - Rank: 4/248, Score: 23
Fix the column order in this table... also append the new 'username' column.
HTML to Haml - Rank: 4/467, Score: 27
Help convert this HTML page to Haml.
Line Zipper - Rank: 4/303, Score: 13
Zip/pair related lines.
Remove semicolons after expressions - Rank: 5/257, Score: 6
A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.
un-C-escape string - Rank: 5/36, Score: 12
Convert escape sequences to characters
Numbering a List - Rank: 5/941, Score: 15
Pretty simple, number the list.
Exchanging Quotes - Rank: 5/488, Score: 31
Sometimes you need to exchange a choice of quotes in some code.
Reverse and double space - Rank: 5/281, Score: 14
Reverse the order of the given lines and double space everything
Calculate table total - Rank: 6/138, Score: 13
Find the total cost of all the books ASAP.
Interweave two blocks of text - Rank: 6/249, Score: 16
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?
PHP Array Syntax -> MailChimp Merge Syntax - Rank: 6/310, Score: 23
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!
Inconsistent real estate paste - Rank: 7/124, Score: 25
Format a hand-typed real estate listing that uses inconsistent punctuation into four sections
Alphabetize the directory - Rank: 7/213, Score: 30
Put the contacts and their information in alphabetical order.
Remember FizzBuzz? - Rank: 7/352, Score: 49
Output FizzBuzz to 100. Start with nothing.
Compile C - Rank: 7/379, Score: 11
You might have to get clever to do this one.
Changing URL path in CSS - Rank: 7/98, Score: 40
What's the quickest way to swap out all the URLs in a CSS file? Is it wasted keystrokes using look-behinds and look-aheads? (I'm sorry for the delete/report--I made a mistake with the last one requiring an ugly search for graphic to replace with images. I just intended this to be a simple search and replace that might possibly generate some macros or normals solutions that are quicker)
imports alignment (python) - Rank: 8/402, Score: 17
Align as one import per line.
Hatsuyume - Rank: 8/322, Score: 15
http://en.wikipedia.org/wiki/Hatsuyume
Before there was Farmville... - Rank: 8/72, Score: 173
There was old MacDonald. For my toddler. The first Vim sing-a-long?
Aligning function arguments to match a specific coding style - Rank: 8/117, Score: 17
Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.
Happy New Year! - Rank: 10/110, Score: 24
This is a simple new year's challenge.
Replacing some words - Rank: 10/303, Score: 17
How fast could it be?
Reformat/Refactor a Golfer Class - Rank: 10/2964, Score: 32
A simple case of removing unneeded code and fixing broken indentation.
Reverse and count - Rank: 11/358, Score: 21
Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.
Make it more readable - Rank: 11/774, Score: 13
Insert blank lines to make it more organized and readable
Here, piggy, piggy... - Rank: 11/56, Score: 93
Youay owknay atwhay otay oday...
Remove noise from HTTP log - Rank: 12/293, Score: 15
This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.
expand a list comprehension (python) - Rank: 12/202, Score: 43
Please show your way to convert a list comprehension in python to an ordinary for-loop expression!
Vertical Limit - Rank: 13/563, Score: 22
transform a succession of one word lines to a an array of strings
Remove duplicate items - Rank: 13/341, Score: 12
Input is a list of numbers. Produce a set of unique numbers from input.
Turn this csv list into queries - Rank: 13/158, Score: 106
Transform each line of this csv file into a MySQL-ready INSERT query.
Reformat some Python - Rank: 13/384, Score: 34
Fix some very bizarrely laid-out code.
Sorting paragraphs - Rank: 13/341, Score: 23
Order the paragraphs correctly, per prefixed index
Ugly spreadsheet copy/paste to CSV - Rank: 14/358, Score: 21
convert an ugly spreadsheet copy/paste into a CSV format.
Reconstruct the Sentence - Rank: 14/743, Score: 20
Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.
Cartesian product - Rank: 14/160, Score: 26
{1,2,3,4,5} X {1,2,3,4,5}
Ruby 1.9 compat - Rank: 15/423, Score: 14
Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!
remove dupes from array - Rank: 15/639, Score: 17
given a random string that contains a ruby-esque array, make sure that there are no duplicate elements
Reformat long lines - Rank: 16/261, Score: 15
Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.
Sort the cardinal numbers - Rank: 16/168, Score: 12
Maybe a simple challenge.
Ruby 1.9 hashes - Rank: 16/646, Score: 12
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!
It'ss tooo coold too typpe todaay - Rank: 17/170, Score: 17
My hands are numb with cold. It's hard to type correctly.
SFD-ROC: vimvimvim - Rank: 17/415, Score: 8
Oh no, this line is longer than 80 chars... put each 'vim' on a new line.
Switch function arguments - Rank: 18/632, Score: 11
How to switch two arguments of a function.
Whitespace, empty lines and tabs - Rank: 18/1562, Score: 17
Convert tabs to spaces, strip empty lines and trailing whitespace.
Add fold markers to a .c file - Rank: 18/374, Score: 30
Fold markers can make it easier to navigate source code. Add them to this .c file.
Another Mixed-Up Haiku - Rank: 20/173, Score: 21
VimGolf ... a perfect evening?
Flodder-challenge - Rank: 20/684, Score: 28
Replace the text the most efficient and win!
Deleting folded text - Rank: 20/239, Score: 19
The text below contains three folds. Delete them (and the text inside them). For example: 123 456 /*{{{*/ 789 /*}}}*/ 012 Should become: 123 012 Also, add `aoeuaoeu` to make sure small solutions don't get flagged as cheating.
The meaning - Rank: 21/314, Score: 5
Numbers are fun!
Overall Vimgolf Rank - Rank: 22/112, Score: 28
Suppose you are trying to figure out what your overall rank is at Vimgolf(the sum of all the ranks you got), and as a Vim ninja you decided to use Vim to do the job. Your solution should work for every Vimgolf profile page(The actual input file for this challenge is my Vimgolf profile page). So, direct answer insertion is considered cheating.
Sort entries based on date - Rank: 23/258, Score: 11
Sort some entries in a Ledger-file based on date.
Increment, increment, increment.... - Rank: 23/308, Score: 11
Vim likes macros
Case preserving word replacement - Rank: 25/305, Score: 19
Half way through my project, my people turned into dogs. Now I have to change everything in my source.
Python Hello World! Reformatting - Rank: 27/532, Score: 41
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.
Simple text editing with Vim - Rank: 28/3620, Score: 13
Make the pairs of lines match up by making each second line same as first
Reformat a C golf submission - Rank: 29/392, Score: 26
Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.
Wrap the text of an email message to 79 characters - Rank: 30/375, Score: 5
You're replying to an email with silly long lines. Clean them up.
Reformat most common surnames - Rank: 31/384, Score: 26
Reformat copy-pasted table into a list of the most common surnames
Make Fancy Header - Rank: 35/574, Score: 16
Make the header text stand out with surrounding asterisks
Assignment Alignment - Rank: 37/453, Score: 20
line up the operators. Use spaces, not tabs.
Indentation - Rank: 38/353, Score: 24
Indent each line according to the right number of spaces it needs.
Reverse a single line - Rank: 38/562, Score: 9
Reverse a single line vertically.
Generate English Alphabets - Rank: 38/291, Score: 24
Start with a, get up to z.
Context insensitive completion 0 - Rank: 40/360, Score: 7
Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.
Reverse characters in a line - Rank: 43/532, Score: 8
You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.
Get rid of html tags - Rank: 45/246, Score: 17
Want to read more about Vim's background? Then get rid of those html tags...
Almost encrypted - Rank: 50/137, Score: 5
Convert the first paragraph to be even less readable.
Context Insensitive completion 1 - Rank: 54/311, Score: 18
Finish writing this simple Python HTTP server.
Do you have a big gun? - Rank: 57/184, Score: 5
Of course I have.
Change the content of a string - Rank: 73/768, Score: 22
This docstring is a complete lie. Fix it.
switch variable - Rank: 74/1228, Score: 11
how fast can you switch two variable ?
The Cake is a Lie - Rank: 82/647, Score: 9
Correct the capitalization of each word
Search and Replace 0 - Rank: 86/1501, Score: 12
Replace every instance of 'aaa' with 'xaaax'.
The name of the game - Rank: 86/266, Score: 11
End up with the name of the game.
The holy-grail may help - Rank: 93/233, Score: 16
Can you find it in less than 20 strokes, Arthur?
A Simple One - Rank: 164/601, Score: 9
Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...
Federico Galassi
Twitter: @federicogalassi
software craftsman. I love javascript, ruby, vim, git, the pomodoro technique, agile and books.
VimGolf