Real Vim ninjas count every keystroke - do you?

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

Leaderboard, Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

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

Top Entries

Reformat long lines - Rank: 1/261, Score: 15

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

Before there was Farmville... - Rank: 10/72, Score: 206

There was old MacDonald. For my toddler. The first Vim sing-a-long?

Ruby 1.9 hashes - Rank: 12/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!

categorize the shopping list - Rank: 22/61, Score: 279

Going to the store with an unorganized shopping list is like programming with Notepad. Help the shopper efficiently navigate the aisles to avoid unnecessary footsteps.

Cartesian product - Rank: 25/160, Score: 32

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

Getters & Setters: Java - Rank: 26/102, Score: 127

Boilerplate getters & setters - it's a tedious fact of life in Java, and probably the only thing that still pulls me back to an IDE. Perhaps someone knows a fast, pure vim way...

The Universal Declaration of Human Rights, Article 1 - Rank: 29/114, Score: 26

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.)

Promote that perl 'one-liner' ... - Rank: 34/109, Score: 114

You've just sorted your data using perl -e, when suddenly you have to add a row and do it again. That's twice - you'll almost certainly do it again. Time to turn it into a real script. We'll start from having pasted it in ...

Insert a Markdown link - Rank: 35/320, Score: 24

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

Rotating Philosophers Problem - Rank: 35/295, Score: 30

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

CSV to JSON - Rank: 35/120, Score: 145

A search for shortest vimissh way to convert CSV to JSON.

The holy-grail may help - Rank: 42/233, Score: 16

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

Reverse characters in a line - Rank: 45/532, Score: 8

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

Reformat a C golf submission - Rank: 47/392, Score: 28

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

Sort and add attributes - Rank: 48/798, Score: 33

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

Reverse and count - Rank: 53/358, Score: 25

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

Add fold markers to a .c file - Rank: 55/374, Score: 34

Fold markers can make it easier to navigate source code. Add them to this .c file.

expand a list comprehension (python) - Rank: 55/202, Score: 59

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

HTML to Haml - Rank: 64/467, Score: 40

Help convert this HTML page to Haml.

imports alignment (python) - Rank: 69/402, Score: 23

Align as one import per line.

Do you have a big gun? - Rank: 76/184, Score: 5

Of course I have.

Assignment Alignment - Rank: 82/453, Score: 29

line up the operators. Use spaces, not tabs.

Flodder-challenge - Rank: 87/684, Score: 35

Replace the text the most efficient and win!

Search and Replace 0 - Rank: 90/1501, Score: 12

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

Reconstruct the Sentence - Rank: 101/743, Score: 21

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

Shebangs for all - Rank: 117/729, Score: 15

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.

A Simple One - Rank: 129/601, Score: 9

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

Braces or Brackets? - Rank: 168/595, Score: 52

Someone forgot whether to use braces or brackets and you have to clean up their code!

Change the content of a string - Rank: 169/768, Score: 25

This docstring is a complete lie. Fix it.

Whitespace, empty lines and tabs - Rank: 172/1562, Score: 24

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

Reverse a single line - Rank: 186/562, Score: 21

Reverse a single line vertically.

Reformat/Refactor a Golfer Class - Rank: 312/2965, Score: 39

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

Simple text editing with Vim - Rank: 493/3635, Score: 16

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

Contributed Challenges

categorize the shopping list - 61 entries

Going to the store with an unorganized shopping list is like programming with Notepad. Help the shopper efficiently navigate the aisles to avoid unnecessary footsteps.

1309650785306_normal
Rob Ciaccio
Twitter:

guitar player, engineer, software/hardware junkie, and general tinkerer in the seattle area

entered into 33 challenges

contributed 1 challenges