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 - 404 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: #79 / 114
  • Number of attempts: 2
Fix the shell script! - 2049 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 26
  • Position: #51 / 492
  • Number of attempts: 10
Inverting Lines - 1774 entries

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

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

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

  • Best score: 5
  • Best player score: 9
  • Position: #357 / 384
  • Number of attempts: 2
Search and Replace 0 - 4785 entries

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

  • Best score: 12
  • Best player score: 18
  • Position: #1272 / 1584
  • Number of attempts: 1
VimGolfNight - 531 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #171 / 342
  • 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 ! - 10615 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #25 / 3662
  • 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 - 3124 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 / 1071
  • Number of attempts: 4
Words in parens - 12848 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #222 / 3943
  • 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 - 243 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 / 91
  • 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 - 1084 entries

Oops, I spelled that wrong.

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

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #234 / 1733
  • Number of attempts: 3
Generate Fibonacci Numbers - 257 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 - 340 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 - 459 entries

Start with a, get up to z.

  • Best score: 19
  • Best player score: 25
  • Position: #85 / 198
  • Number of attempts: 1
The holy-grail may help - 343 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 - 995 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 / 640
  • Number of attempts: 1
82 bottles of beer on the wall - 300 entries

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

  • Best score: 106
  • Best player score: 144
  • Position: #106 / 140
  • Number of attempts: 1
Ruby 1.9 compat - 609 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: #203 / 229
  • Number of attempts: 1
Indentation - 496 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 - 502 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: #217 / 231
  • Number of attempts: 1
Context Insensitive completion 1 - 456 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #42 / 231
  • Number of attempts: 4
Reformat a C golf submission - 552 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: #155 / 199
  • 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 - 1453 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Position: #406 / 550
  • Number of attempts: 1
Braces or Brackets? - 860 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: #240 / 283
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3278 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #232 / 726
  • Number of attempts: 6
Simple text editing with Vim - 12204 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 / 3560
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6499 entries

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

  • Best score: 32
  • Best player score: 32
  • Position: #82 / 1599
  • 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 38 challenges

contributed 0 challenges