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 - 822 entries

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

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

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

  • Best score: 12
  • Best player score: 13
  • Position: #773 / 1631
  • Number of attempts: 4
Python Hello World! Reformatting - 1006 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: #282 / 383
  • Number of attempts: 1
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1267 / 1750
  • 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 - 2009 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 17
  • Position: #424 / 652
  • Number of attempts: 1
remove dupes from array - 1360 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 / 337
  • 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 - 456 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: #171 / 181
  • Number of attempts: 1
expand a list comprehension (python) - 334 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 / 110
  • Number of attempts: 1
Reformat long lines - 367 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: #117 / 136
  • Number of attempts: 1
Numbering a List - 1939 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 22
  • Position: #430 / 655
  • Number of attempts: 2
Ruby 1.9 hashes - 1260 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: #383 / 410
  • Number of attempts: 1
A Simple One - 1064 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 / 670
  • 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.... - 701 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #222 / 413
  • Number of attempts: 1
The Cake is a Lie - 1374 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 11
  • Position: #428 / 534
  • Number of attempts: 1
Context insensitive completion 0 - 590 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: #195 / 249
  • Number of attempts: 1
Reverse characters in a line - 778 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: #248 / 268
  • Number of attempts: 1
Change the content of a string - 1649 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #271 / 609
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3795 entries

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

  • Best score: 16
  • Best player score: 35
  • Position: #691 / 816
  • Number of attempts: 1
Simple text editing with Vim - 13123 entries

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

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

entered into 22 challenges

contributed 0 challenges