### Real Vim ninjas count every keystroke - do you?

###### Pick a challenge, fire up Vim, and show us what you got.

```Your VimGolf key: please sign in

\$ gem install vimgolf
\$ vimgolf setup
\$ vimgolf put [challenge ID]
```

### Played Challenges

##### Search and Replace 0 - 4722 entries

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

• Best score: 12
• Best player score: 12
• Position: #152 / 1562
• Number of attempts: 2
##### Sierpinski's Triangle - 82 entries

Build the famous fractal, Sierpinski's Triangle.

• Best score: 25
• Best player score: 36
• Position: #18 / 24
• Number of attempts: 1
##### Swap assigned value - 567 entries

Simple problem but looking for interesting solutions.

• Best score: 10
• Best player score: 11
• Position: #117 / 237
• Number of attempts: 2
##### REDRUM - 147 entries

If you remember "The Shinning", the first time you saw the bloody word REDRUM you probably thinked "What the Hell is that?" Well, then you know that you need a little help from a looking-glass to make sense of it. Now it's time to use vim like a mirror to reveal the message.

• Best score: 14
• Best player score: 15
• Position: #24 / 60
• Number of attempts: 3
##### 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: #31 / 86
• Number of attempts: 2
##### Sort by your own sum - 61 entries

Same numbers as last time, but you'll have to add them yourself.

• Best score: 25
• Best player score: 32
• Position: #6 / 25
• Number of attempts: 1
##### Sort by sum of numbers in a line(?) - 53 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: #18 / 34
• 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: 25
• Position: #13 / 89
• Number of attempts: 3
##### Dehamlizing - 177 entries

Change this piece of HAML code back into erb

• Best score: 32
• Best player score: 45
• Position: #54 / 68
• Number of attempts: 1
##### Changing URL path in CSS - 123 entries

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)

• Best score: 40
• Best player score: 45
• Position: #33 / 57
• Number of attempts: 1
##### Checkerboard case pattern - 138 entries

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

• Best score: 15
• Best player score: 17
• Position: #19 / 55
• Number of attempts: 3
##### NATO phonetic alphabet - 490 entries

Transform the series of words into a list.

• Best score: 19
• Best player score: 24
• Position: #140 / 185
• Number of attempts: 1
##### Shuffle and Sort - 201 entries

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

• Best score: 17
• Best player score: 27
• Position: #44 / 63
• Number of attempts: 1
##### Printable ASCII characters - 120 entries

From a blank input, print all 95 printing ASCII characters one per line, from space to tilde.

• Best score: 22
• Best player score: 36
• Position: #22 / 40
• Number of attempts: 1
##### A simple change - 429 entries

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

• Best score: 12
• Best player score: 14
• Position: #61 / 184
• Number of attempts: 1
##### Extract text from xml - 106 entries

Extract text from xml file (ignoring commented out elements) and create a one line regex.

• Best score: 28
• Best player score: 35
• Position: #13 / 43
• Number of attempts: 2
##### 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: #28 / 183
• Number of attempts: 2
##### The name of the game - 637 entries

End up with the name of the game.

• Best score: 11
• Best player score: 11
• Position: #21 / 349
• Number of attempts: 1
##### Chucking wood - 92 entries

An exercise in compressing repetitive text. For this challenge, any entry that uses keys outside the main row (such as arrow keys, Home, End, Delete, etc.) will be removed. (Esc is OK, though you should be using C-[ anyway.)

• Best score: 51
• Best player score: 54
• Position: #11 / 40
• Number of attempts: 2
##### Stairs Indenting - 440 entries

Indent each line with <line number> whitespaces.

• Best score: 12
• Best player score: 13
• Position: #26 / 189
• Number of attempts: 4
##### 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: 24
• Position: #40 / 70
• Number of attempts: 1
##### Flip the chessboard - 77 entries

White's turn is over. Flip the board to black's perspective. I added coordinates to frustrate you.

• Best score: 18
• Best player score: 21
• Position: #10 / 29
• Number of attempts: 2
##### Make the circuit grid! - 79 entries

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.

• Best score: 26
• Best player score: 29
• Position: #35 / 45
• Number of attempts: 1
##### Exchanging Quotes - 800 entries

Sometimes you need to exchange a choice of quotes in some code.

• Best score: 30
• Best player score: 32
• Position: #56 / 220
• Number of attempts: 4
##### replacing each line of a block selection - 2871 entries

replace each line's ../assets/js with /javascripts

• Best score: 18
• Best player score: 21
• Position: #290 / 751
• Number of attempts: 2
##### Switch function arguments - 1996 entries

How to switch two arguments of a function.

• Best score: 11
• Best player score: 12
• Position: #201 / 632
• Number of attempts: 3
##### Append semicolon after expressions - 975 entries

Some lines need the semicolon, some don't.

• Best score: 11
• Best player score: 11
• Position: #12 / 394
• 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: #24 / 187
• Number of attempts: 2
##### 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: 16
• Position: #149 / 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: 8
• Position: #162 / 245
• Number of attempts: 1
##### switch variable - 4974 entries

how fast can you switch two variable ?

• Best score: 11
• Best player score: 11
• Position: #13 / 1715
• Number of attempts: 2
##### Ugly spreadsheet copy/paste to CSV - 926 entries

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

• Best score: 19
• Best player score: 35
• Position: #100 / 179
• Number of attempts: 2
##### Replacing some words - 417 entries

How fast could it be?

• Best score: 17
• Best player score: 21
• Position: #66 / 146
• Number of attempts: 1
##### Sort the cardinal numbers - 283 entries

Maybe a simple challenge.

• Best score: 12
• Best player score: 12
• Position: #19 / 142
• Number of attempts: 2
##### formatted text to markdown - 180 entries

You're converting some posts from an old blog to markdown. The formatted text is far closer to the finished product than the html markup, so it seems like a good place to start. Word wrapping seems to be the main area for optimization.

• Best score: 70
• Best player score: 79
• Position: #39 / 65
• Number of attempts: 2
##### Make it more readable - 1923 entries

Insert blank lines to make it more organized and readable

• Best score: 13
• Best player score: 16
• Position: #317 / 632
• Number of attempts: 2
##### Line Zipper - 448 entries

Zip/pair related lines.

• Best score: 12
• Best player score: 16
• Position: #150 / 208
• Number of attempts: 1
##### 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: 18
• Position: #88 / 328
• Number of attempts: 5
##### Alphabetize the directory - 281 entries

Put the contacts and their information in alphabetical order.

• Best score: 30
• Best player score: 32
• Position: #33 / 98
• Number of attempts: 3
##### 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: 24
• Position: #31 / 145
• Number of attempts: 2
##### 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: #51 / 112
• Number of attempts: 1
##### Refactor to Helpers - 45 entries

This Rails partial is almost all template escapes. Put it into a helper, and refactor each case to methods so we can build out the controls for each. (I've converted to tabs - fighting with Vimgolf's default config shouldn't be part of the challenge.)

• Best score: 147
• Best player score: 286
• Position: #11 / 22
• Number of attempts: 1
##### imports alignment (python) - 656 entries

Align as one import per line.

• Best score: 17
• Best player score: 20
• Position: #83 / 193
• Number of attempts: 4
##### HTML to Haml - 837 entries

Help convert this HTML page to Haml.

• Best score: 23
• Best player score: 33
• Position: #82 / 200
• Number of attempts: 2
##### 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: 17
• Position: #62 / 129
• Number of attempts: 4
##### 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: 14
• Position: #205 / 387
• Number of attempts: 4
##### Assignment Alignment - 823 entries

line up the operators. Use spaces, not tabs.

• Best score: 18
• Best player score: 18
• Position: #23 / 214
• Number of attempts: 5
##### 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: 12
• Position: #117 / 471
• Number of attempts: 2
##### 82 bottles of beer on the wall - 293 entries

Take them down. (sorry, only 82 bottles because the problem size is limited!)

• Best score: 107
• Best player score: 121
• Position: #41 / 137
• Number of attempts: 2
##### Table Reshuffle - 360 entries

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

• Best score: 22
• Best player score: 29
• Position: #58 / 129
• Number of attempts: 3
##### 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: 22
• Position: #32 / 162
• Number of attempts: 5
##### Ruby 1.9 compat - 598 entries

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!

• Best score: 14
• Best player score: 14
• Position: #27 / 227
• Number of attempts: 2
##### Reverse Simple Deletion - 800 entries

You did the simple deletion, now reverse it.

• Best score: 11
• Best player score: 12
• Position: #215 / 441
• Number of attempts: 1
##### Increment, increment, increment.... - 600 entries

Vim likes macros

• Best score: 10
• Best player score: 12
• Position: #201 / 382
• Number of attempts: 1
##### The Cake is a Lie - 1238 entries

Correct the capitalization of each word

• Best score: 9
• Best player score: 10
• Position: #319 / 497
• Number of attempts: 1
##### Context insensitive completion 0 - 479 entries

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.

• Best score: 7
• Best player score: 7
• Position: #62 / 225
• 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: #99 / 495
• Number of attempts: 1
##### 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: #157 / 352
• Number of attempts: 1
##### Whitespace, empty lines and tabs - 3060 entries

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

• Best score: 16
• Best player score: 17
• Position: #34 / 677
• Number of attempts: 7
##### Simple text editing with Vim - 11770 entries

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

• Best score: 13
• Best player score: 14
• Position: #869 / 3449
• Number of attempts: 1