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

Simple, Practical, and Common - 33483 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 22
  • Position: #151 / 7384
  • Number of attempts: 6
Wrap the text of an email message to 79 characters - 705 entries

You're replying to an email with silly long lines. Clean them up.

  • Best score: 5
  • Best player score: 11
  • Position: #376 / 398
  • Number of attempts: 1
Search and Replace 0 - 4853 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #103 / 1605
  • Number of attempts: 4
Just the middle - 11380 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #56 / 4174
  • Number of attempts: 3
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: 17
  • Position: #70 / 212
  • Number of attempts: 3
Array of characters - 157 entries

We all copy paste things off the internet, but the syntax doesn't look right. Fix it as fast as possible.

  • Best score: 33
  • Best player score: 37
  • Position: #23 / 46
  • Number of attempts: 5
Cartesian product - 222 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 34
  • Position: #56 / 93
  • Number of attempts: 3
increment by column in XML - 147 entries

modify an arbitrary "column" in an xml table by incrementing a an arbitrary placeholder string

  • Best score: 19
  • Best player score: 20
  • Position: #13 / 54
  • Number of attempts: 3
range(10) digit rotation - 33 entries

This is a data generator challenge or some kind of gift..

  • Best score: 18
  • Best player score: 18
  • Position: #2 / 21
  • Number of attempts: 1
I forgot quotes - 15946 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #54 / 4166
  • Number of attempts: 5
Neither Fizz nor Buzz - 235 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 15
  • Position: #18 / 102
  • Number of attempts: 3
Do you demand a shrubbery? - 1136 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 15
  • Position: #11 / 298
  • Number of attempts: 5
Where should I put the Newline? - 874 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #6 / 436
  • Number of attempts: 4
Shuffle puzzle - 331 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 13
  • Position: #8 / 103
  • Number of attempts: 5
A HAPPY NEW YEAR 2014 ! - 10652 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #281 / 3677
  • Number of attempts: 5
Words in parens - 12868 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 23
  • Position: #3628 / 3950
  • Number of attempts: 2
Recursively Palindrome - 245 entries

Note that there are 2^6-1 characters.

  • Best score: 21
  • Best player score: 24
  • Position: #38 / 74
  • Number of attempts: 2
Exchanging Quotes - 824 entries

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

  • Best score: 30
  • Best player score: 55
  • Position: #219 / 227
  • Number of attempts: 1
replacing each line of a block selection - 2966 entries

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

  • Best score: 18
  • Best player score: 21
  • Position: #294 / 772
  • Number of attempts: 2
switch variable - 5045 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #2 / 1742
  • Number of attempts: 2
The meaning - 566 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #2 / 360
  • Number of attempts: 1
Multiplication table. - 206 entries

Create a multiplication table.

  • Best score: 31
  • Best player score: 77
  • Position: #36 / 64
  • 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: 14
  • Position: #115 / 643
  • Number of attempts: 3
Line Zipper - 454 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 16
  • Position: #99 / 212
  • Number of attempts: 2
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: 33
  • Position: #81 / 149
  • Number of attempts: 3
Complete the hex array data - 196 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

  • Best score: 23
  • Best player score: 26
  • Position: #23 / 73
  • Number of attempts: 2
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: 19
  • Position: #6 / 180
  • Number of attempts: 2
Complete the hex array data (Part II) - 157 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

  • Best score: 20
  • Best player score: 22
  • Position: #12 / 68
  • Number of attempts: 1
Sort entries based on date - 364 entries

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

  • Best score: 11
  • Best player score: 11
  • Position: #3 / 115
  • Number of attempts: 3
Refactor to Helpers - 49 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: 855
  • Position: #24 / 24
  • Number of attempts: 1
imports alignment (python) - 663 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 36
  • Position: #172 / 196
  • Number of attempts: 1
Rotating Philosophers Problem - 392 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

  • Best score: 29
  • Best player score: 33
  • Position: #125 / 165
  • Number of attempts: 1
HTML to Haml - 843 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 49
  • Position: #165 / 203
  • Number of attempts: 1
expand a list comprehension (python) - 302 entries

Please show your way to convert a list comprehension in python to an ordinary for-loop expression!

  • Best score: 42
  • Best player score: 73
  • Position: #101 / 107
  • Number of attempts: 1
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: #3 / 133
  • Number of attempts: 4
Numbering a List - 1869 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Position: #152 / 646
  • Number of attempts: 2
Java Array2List - 227 entries

Convert an java array initializer into a list.

  • Best score: 67
  • Best player score: 84
  • Position: #22 / 85
  • Number of attempts: 4
The holy-grail may help - 352 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 16
  • Position: #73 / 207
  • Number of attempts: 2
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: 12
  • Position: #19 / 402
  • Number of attempts: 8
Assignment Alignment - 842 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 18
  • Position: #14 / 217
  • Number of attempts: 8
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: 12
  • Position: #99 / 502
  • Number of attempts: 8
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: #176 / 648
  • Number of attempts: 3
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: 24
  • Position: #67 / 174
  • Number of attempts: 7
Reverse Simple Deletion - 834 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #185 / 455
  • Number of attempts: 3
Increment, increment, increment.... - 668 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #184 / 404
  • 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: #88 / 517
  • Number of attempts: 3
Context insensitive completion 0 - 545 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: 6
  • Best player score: 7
  • Position: #43 / 239
  • Number of attempts: 3
Compile C - 366 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 21
  • Position: #42 / 133
  • Number of attempts: 1
Almost encrypted - 199 entries

Convert the first paragraph to be even less readable.

  • Best score: 5
  • Best player score: 5
  • Position: #59 / 145
  • Number of attempts: 1
Make Fancy Header - 1024 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #37 / 340
  • Number of attempts: 4
Whitespace, empty lines and tabs - 3508 entries

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

  • Best score: 16
  • Best player score: 28
  • Position: #454 / 758
  • Number of attempts: 2
Simple text editing with Vim - 12491 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #2 / 3626
  • Number of attempts: 8
Reformat/Refactor a Golfer Class - 6749 entries

A simple case of removing unneeded code and fixing broken indentation.

  • Best score: 31
  • Best player score: 36
  • Position: #407 / 1652
  • Number of attempts: 8
Pavlo Klets
Twitter:

Freak & geak..

entered into 53 challenges

contributed 0 challenges