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

Wrap the text of an email message to 79 characters - 787 entries

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

  • Best score: 5
  • Best player score: 16
  • Position: #403 / 416
  • Number of attempts: 1
Search and Replace 0 - 4994 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #770 / 1627
  • Number of attempts: 4
Python Hello World! Reformatting - 994 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
  • Position: #279 / 380
  • Number of attempts: 1
switch variable - 5079 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1266 / 1749
  • Number of attempts: 3
Replacing some words - 428 entries

How fast could it be?

  • Best score: 17
  • Best player score: 25
  • Position: #92 / 151
  • Number of attempts: 3
Make it more readable - 2005 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 17
  • Position: #423 / 650
  • Number of attempts: 1
remove dupes from array - 1358 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
  • Position: #239 / 336
  • Number of attempts: 2
PHP Array Syntax -> MailChimp Merge Syntax - 545 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
  • Position: #96 / 150
  • Number of attempts: 1
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: 28
  • Position: #170 / 180
  • Number of attempts: 1
expand a list comprehension (python) - 333 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
  • Position: #90 / 109
  • Number of attempts: 1
Reformat long lines - 358 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
  • Position: #116 / 134
  • Number of attempts: 1
Numbering a List - 1932 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 22
  • Position: #428 / 653
  • Number of attempts: 2
Ruby 1.9 hashes - 1244 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
  • Position: #379 / 406
  • Number of attempts: 1
A Simple One - 1051 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: #246 / 665
  • Number of attempts: 1
Letters are numbers - 167 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
  • Position: #62 / 76
  • Number of attempts: 1
Increment, increment, increment.... - 689 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #219 / 409
  • Number of attempts: 1
The Cake is a Lie - 1349 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #424 / 528
  • Number of attempts: 1
Context insensitive completion 0 - 577 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: 9
  • Position: #192 / 246
  • Number of attempts: 1
Reverse characters in a line - 771 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
  • Position: #245 / 265
  • Number of attempts: 1
Change the content of a string - 1588 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #264 / 592
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3691 entries

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

  • Best score: 16
  • Best player score: 35
  • Position: #677 / 794
  • Number of attempts: 1
Simple text editing with Vim - 12856 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #2170 / 3707
  • Number of attempts: 3
Dj Vimgolf
Twitter:

entered into 22 challenges

contributed 0 challenges