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

New teacher - 836 entries

Update the details of the new CS teacher.

  • Best score: 19
  • Best player score: 22
  • Position: #43 / 174
  • Number of attempts: 4
Remove line numbers - 694 entries

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

  • Best score: 9
  • Best player score: 24
  • Position: #132 / 189
  • Number of attempts: 2
Fix the shell script! - 2544 entries

Fix the shell script with the fewest keystrokes!

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

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

  • Best score: 17
  • Best player score: 31
  • Position: #92 / 203
  • Number of attempts: 4
Inverting Lines - 1881 entries

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

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

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

  • Best score: 5
  • Best player score: 9
  • Position: #377 / 405
  • Number of attempts: 2
Search and Replace 0 - 4973 entries

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

  • Best score: 12
  • Best player score: 18
  • Position: #1303 / 1619
  • Number of attempts: 1
VimGolfNight - 555 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #171 / 345
  • Number of attempts: 2
Two become one - 713 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: #22 / 208
  • Number of attempts: 12
Piphilology - 144 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: 28
  • Best player score: 29
  • Position: #6 / 52
  • Number of attempts: 3
Shuffle puzzle - 346 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 / 104
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 10657 entries

A HAPPY NEW YEAR 2014 !

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

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

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

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

  • Best score: 16
  • Best player score: 16
  • Position: #5 / 115
  • Number of attempts: 11
Letter case trickery - 1621 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: #77 / 516
  • Number of attempts: 8
quotes inside quotes - 3154 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 / 1075
  • Number of attempts: 4
Words in parens - 12928 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #226 / 3960
  • Number of attempts: 3
Hole-in-one - 1017 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: #49 / 303
  • Number of attempts: 7
Readable Rubyhash - 263 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: #11 / 94
  • Number of attempts: 9
Saving the hashes(#) - 2053 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 / 479
  • Number of attempts: 10
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

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

how fast can you switch two variable ?

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

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 21
  • Position: #45 / 99
  • Number of attempts: 2
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: 21
  • Position: #89 / 134
  • Number of attempts: 2
Generate English Alphabets - 487 entries

Start with a, get up to z.

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

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

  • Best score: 16
  • Best player score: 16
  • Position: #61 / 208
  • Number of attempts: 1
A Simple One - 1043 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 / 659
  • Number of attempts: 1
82 bottles of beer on the wall - 310 entries

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

  • Best score: 106
  • Best player score: 144
  • Position: #108 / 144
  • Number of attempts: 1
Ruby 1.9 compat - 624 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: #206 / 232
  • Number of attempts: 1
Indentation - 534 entries

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

  • Best score: 20
  • Best player score: 60
  • Position: #169 / 177
  • Number of attempts: 1
Turn this csv list into queries - 237 entries

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

  • Best score: 98
  • Best player score: 114
  • Position: #34 / 99
  • Number of attempts: 3
Context insensitive completion 0 - 558 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: #228 / 242
  • Number of attempts: 1
Context Insensitive completion 1 - 494 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #42 / 243
  • Number of attempts: 4
Reformat a C golf submission - 582 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: #161 / 206
  • Number of attempts: 1
Get rid of html tags - 394 entries

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

  • Best score: 12
  • Best player score: 21
  • Position: #176 / 228
  • Number of attempts: 1
Change the content of a string - 1552 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Position: #426 / 580
  • Number of attempts: 1
Braces or Brackets? - 959 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: #256 / 307
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3589 entries

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

  • Best score: 16
  • Best player score: 22
  • Position: #254 / 775
  • Number of attempts: 6
Simple text editing with Vim - 12692 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 / 3667
  • Number of attempts: 4
Reformat/Refactor a Golfer Class - 6873 entries

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

  • Best score: 28
  • Best player score: 32
  • Position: #83 / 1683
  • 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 40 challenges

contributed 0 challenges