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 - 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: 42
  • Position: #101 / 380
  • Number of attempts: 2
imports alignment (python) - 700 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 20
  • Position: #70 / 198
  • Number of attempts: 7
HTML to Haml - 878 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 44
  • Position: #136 / 204
  • Number of attempts: 4
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: 54
  • Position: #57 / 109
  • Number of attempts: 2
Generate English Alphabets - 487 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 25
  • Position: #100 / 206
  • Number of attempts: 2
The Universal Declaration of Human Rights, Article 1 - 163 entries

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

  • Best score: 24
  • Best player score: 32
  • Position: #64 / 71
  • Number of attempts: 2
Getters & Setters: Java - 207 entries

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

  • Best score: 89
  • Best player score: 248
  • Position: #55 / 58
  • Number of attempts: 1
Java Array2List - 233 entries

Convert an java array initializer into a list.

  • Best score: 67
  • Best player score: 111
  • Position: #55 / 87
  • Number of attempts: 2
The holy-grail may help - 366 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #71 / 209
  • 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: 12
  • Position: #18 / 406
  • Number of attempts: 6
Assignment Alignment - 883 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 18
  • Position: #13 / 220
  • Number of attempts: 10
Shebangs for all - 1999 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: 14
  • Position: #216 / 516
  • Number of attempts: 7
A Simple One - 1050 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: #174 / 664
  • Number of attempts: 2
82 bottles of beer on the wall - 313 entries

Take them down. (sorry, only 82 bottles because the problem size is limited!)

  • Best score: 106
  • Best player score: 129
  • Position: #71 / 146
  • Number of attempts: 2
Reverse and count - 473 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: #65 / 176
  • Number of attempts: 4
Reverse Simple Deletion - 847 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #183 / 458
  • Number of attempts: 1
Increment, increment, increment.... - 688 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #184 / 408
  • Number of attempts: 2
The Cake is a Lie - 1346 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #323 / 527
  • Number of attempts: 4
Remove Accent off the Letter - 137 entries

Remove all the accent from extremely accented statements.

  • Best score: 37
  • Best player score: 61
  • Position: #18 / 52
  • Number of attempts: 3
Compile C - 430 entries

You might have to get clever to do this one.

  • Best score: 19
  • Best player score: 21
  • Position: #45 / 141
  • Number of attempts: 4
Context Insensitive completion 1 - 498 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #62 / 245
  • Number of attempts: 3
Make Fancy Header - 1052 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 26
  • Position: #310 / 344
  • Number of attempts: 2
Reformat some Python - 609 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 42
  • Position: #114 / 236
  • Number of attempts: 3
Reformat a C golf submission - 604 entries

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

  • Best score: 22
  • Best player score: 32
  • Position: #111 / 208
  • Number of attempts: 4
Change the content of a string - 1580 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #42 / 588
  • Number of attempts: 4
Sort and add attributes - 1452 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #56 / 564
  • Number of attempts: 2
Braces or Brackets? - 1018 entries

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

  • Best score: 34
  • Best player score: 50
  • Position: #227 / 316
  • Number of attempts: 2
Simple text editing with Vim - 12815 entries

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

  • Best score: 13
  • Best player score: 34
  • Position: #3467 / 3696
  • Number of attempts: 2
Reformat/Refactor a Golfer Class - 6984 entries

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

  • Best score: 28
  • Best player score: 33
  • Position: #180 / 1708
  • Number of attempts: 4
Joost
Twitter:

entered into 29 challenges

contributed 0 challenges