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

Python Hello World! Reformatting - 828 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: 45
  • Number of attempts: 1
Whitespace, empty lines and tabs - 2529 entries

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

  • Best score: 16
  • Best player score: 35
  • Number of attempts: 1
Case preserving word replacement - 385 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: 28
  • Number of attempts: 1
Replacing some words - 405 entries

How fast could it be?

  • Best score: 2
  • Best player score: 25
  • Number of attempts: 3
Numbering a List - 1720 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 22
  • Number of attempts: 2
Increment, increment, increment.... - 485 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 1
expand a list comprehension (python) - 240 entries

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

  • Best score: 42
  • Best player score: 65
  • Number of attempts: 1
A Simple One - 834 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
  • Number of attempts: 1
The Cake is a Lie - 1114 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Number of attempts: 1
Simple text editing with Vim - 10332 entries

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

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 3
Wrap the text of an email message to 79 characters - 486 entries

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

  • Best score: 5
  • Best player score: 16
  • Number of attempts: 1
Ruby 1.9 hashes - 1065 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: 21
  • Number of attempts: 1
Context insensitive completion 0 - 443 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: 9
  • Number of attempts: 1
Letters are numbers - 123 entries

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?

  • Best score: 20
  • Best player score: 32
  • Number of attempts: 1
Reverse characters in a line - 572 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: 31
  • Number of attempts: 1
Reformat long lines - 316 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: 23
  • Number of attempts: 1
Change the content of a string - 1229 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 2
Search and Replace 0 - 4054 entries

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

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 4
switch variable - 4281 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 14
  • Number of attempts: 3
PHP Array Syntax -> MailChimp Merge Syntax - 421 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: 35
  • Number of attempts: 1
remove dupes from array - 1190 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: 25
  • Number of attempts: 2
Make it more readable - 1750 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 17
  • Number of attempts: 1
Dj Vimgolf
Twitter:

entered into 22 challenges

contributed 0 challenges