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

Remove line numbers - 535 entries

From http://web.archive.org/web/20140831121704/http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php#investigatingthestackwithgdb.

  • Best score: 12
  • Best player score: 24
  • Position: #98 / 144
  • Number of attempts: 2
Fix the shell script! - 2339 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 26
  • Position: #51 / 541
  • Number of attempts: 10
Visual block training - 1001 entries

You see the input. You see the output. Go.

  • Best score: 17
  • Best player score: 31
  • Position: #86 / 183
  • Number of attempts: 4
Inverting Lines - 1832 entries

A simple challenge to invert all lines, except the first.

  • Best score: 10
  • Best player score: 10
  • Position: #204 / 497
  • Number of attempts: 4
Wrap the text of an email message to 79 characters - 679 entries

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

  • Best score: 5
  • Best player score: 9
  • Position: #359 / 386
  • Number of attempts: 2
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 18
  • Position: #1273 / 1585
  • Number of attempts: 1
VimGolfNight - 536 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #171 / 343
  • Number of attempts: 2
Two become one - 710 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 26
  • Position: #21 / 205
  • Number of attempts: 12
Piphilology - 131 entries

Piphilology comprises the creation and use of mnemonic techniques to remember a span of digits of the mathematical constant π. http://en.wikipedia.org/wiki/Piphilology

  • Best score: 29
  • Best player score: 29
  • Position: #5 / 51
  • Number of attempts: 3
Shuffle puzzle - 317 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 13
  • Position: #6 / 101
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #25 / 3666
  • Number of attempts: 3
attr_aligner - 3444 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 19
  • Position: #39 / 692
  • Number of attempts: 8
Counting in binary - 477 entries

"a" represents 0; "A" represents 1. Start from zero and count to 15.

  • Best score: 16
  • Best player score: 16
  • Position: #5 / 113
  • Number of attempts: 11
Letter case trickery - 1594 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 10
  • Position: #75 / 511
  • Number of attempts: 8
quotes inside quotes - 3125 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

  • Best score: 14
  • Best player score: 14
  • Position: #88 / 1072
  • Number of attempts: 4
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #222 / 3946
  • Number of attempts: 3
Hole-in-one - 1012 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 16
  • Position: #48 / 302
  • Number of attempts: 7
Readable Rubyhash - 244 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: 23
  • Best player score: 24
  • Position: #9 / 92
  • Number of attempts: 9
Saving the hashes(#) - 1992 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 20
  • Position: #19 / 473
  • Number of attempts: 10
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #55 / 441
  • Number of attempts: 6
switch variable - 5036 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #234 / 1736
  • Number of attempts: 3
Generate Fibonacci Numbers - 262 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 21
  • Position: #43 / 97
  • Number of attempts: 2
Reformat long lines - 341 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: 21
  • Position: #86 / 130
  • Number of attempts: 2
Generate English Alphabets - 473 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 25
  • Position: #86 / 202
  • Number of attempts: 1
The holy-grail may help - 345 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #61 / 205
  • Number of attempts: 1
A Simple One - 1001 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: #138 / 643
  • Number of attempts: 1
82 bottles of beer on the wall - 303 entries

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

  • Best score: 106
  • Best player score: 144
  • Position: #106 / 141
  • Number of attempts: 1
Ruby 1.9 compat - 610 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

  • Best score: 14
  • Best player score: 21
  • Position: #204 / 230
  • Number of attempts: 1
Indentation - 497 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 21
  • Best player score: 60
  • Position: #160 / 168
  • Number of attempts: 1
Turn this csv list into queries - 204 entries

Transform each line of this csv file into a MySQL-ready INSERT query.

  • Best score: 98
  • Best player score: 114
  • Position: #32 / 95
  • Number of attempts: 3
Context insensitive completion 0 - 507 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: 12
  • Position: #218 / 232
  • Number of attempts: 1
Context Insensitive completion 1 - 460 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #42 / 233
  • Number of attempts: 4
Reformat a C golf submission - 559 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: 39
  • Position: #156 / 200
  • Number of attempts: 1
Get rid of html tags - 368 entries

Want to read more about Vim's background? Then get rid of those html tags...

  • Best score: 15
  • Best player score: 21
  • Position: #166 / 217
  • Number of attempts: 1
Change the content of a string - 1476 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Position: #410 / 558
  • Number of attempts: 1
Braces or Brackets? - 884 entries

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

  • Best score: 34
  • Best player score: 54
  • Position: #244 / 288
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3339 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #238 / 736
  • Number of attempts: 6
Simple text editing with Vim - 12286 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #228 / 3581
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6558 entries

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

  • Best score: 32
  • Best player score: 32
  • Position: #82 / 1615
  • Number of attempts: 12
alexscott
Twitter:

Compte militant. Informaticien/maçon. Membre @partipirate@mastodon.partipirate.org . Résidant Loire Atlantique. PP : https://t.co/5QV8F6sS37, GFDL, Jürgen Schoner

entered into 39 challenges

contributed 0 challenges