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

vim = 22 / 7 - 475 entries

pi square vim

  • Best score: 20
  • Best player score: 20
  • Position: #28 / 135
  • Number of attempts: 5
V to the i - 4798 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 8
  • Position: #921 / 1891
  • Number of attempts: 1
Extract argument from function - 2355 entries

The aim is to see if you can do some refactoring very fast.

  • Best score: 13
  • Best player score: 15
  • Position: #423 / 752
  • Number of attempts: 1
Search and Replace 0 - 4973 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #358 / 1619
  • Number of attempts: 5
Swap assigned value - 643 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #71 / 253
  • Number of attempts: 6
VimGolfNight - 559 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #198 / 346
  • Number of attempts: 1
vim1001 - 307 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

  • Best score: 17
  • Best player score: 25
  • Position: #80 / 110
  • Number of attempts: 1
Subtraction - 180 entries

Solve the equations.

  • Best score: 18
  • Best player score: 30
  • Position: #51 / 62
  • Number of attempts: 1
Roman numerals - 81 entries

Use the substitutions on top to convert unary to Roman numerals.

  • Best score: 17
  • Best player score: 21
  • Position: #18 / 29
  • Number of attempts: 2
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #181 / 354
  • Number of attempts: 2
Suffix sort - 270 entries

Sort from the end of the line, as if the letters in each line were reversed.

  • Best score: 19
  • Best player score: 33
  • Position: #64 / 67
  • Number of attempts: 1
NBCU Weekly Challenge - Test - 253 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Position: #40 / 116
  • Number of attempts: 2
Change name of a variable - 179 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

  • Best score: 9
  • Best player score: 9
  • Position: #80 / 137
  • Number of attempts: 1
Lisp Condense - 460 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 14
  • Position: #78 / 158
  • Number of attempts: 2
120 Degrees - 493 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 21
  • Position: #90 / 145
  • Number of attempts: 1
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 13
  • Position: #141 / 271
  • Number of attempts: 1
NBCU Weekly Challenge - #0 - 139 entries

One of our favorites lines here at NBCU! p.s. The first version of #0 was deleted due to me copy/pasting a HTML entity. Congrats to the one who figured that out, you are a true ninja warrior!

  • Best score: 30
  • Best player score: 33
  • Position: #37 / 58
  • Number of attempts: 4
Refactor static member invocation - 199 entries

Someone used a static method. Refactor the method into a static import while fixing the assertion.

  • Best score: 28
  • Best player score: 29
  • Position: #20 / 64
  • Number of attempts: 5
Winding path - 122 entries

It's a maze, but the bad paths have been blocked off. Mark the correct path.

  • Best score: 27
  • Best player score: 55
  • Position: #27 / 42
  • Number of attempts: 1
Neither Fizz nor Buzz - 253 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Position: #69 / 103
  • Number of attempts: 3
Do you demand a shrubbery? - 1158 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 28
  • Position: #196 / 300
  • Number of attempts: 2
Don't know what this is - 2014 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

  • Best score: 11
  • Best player score: 14
  • Position: #311 / 582
  • Number of attempts: 1
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: 28
  • Position: #64 / 208
  • Number of attempts: 4
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #121 / 437
  • Number of attempts: 2
Mess in revision history - 1183 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 27
  • Position: #162 / 249
  • Number of attempts: 4
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: 14
  • Position: #40 / 104
  • Number of attempts: 4
Going underground.... - 350 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

  • Best score: 22
  • Best player score: 28
  • Position: #46 / 127
  • Number of attempts: 2
Split the words - 357 entries

Add the spaces manually if you must, but if you use Vim's spell checking feature wisely, I think you'll save a LARGE number of strokes.

  • Best score: 18
  • Best player score: 40
  • Position: #80 / 109
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10657 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1916 / 3679
  • Number of attempts: 1
Counting in binary - 524 entries

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

  • Best score: 16
  • Best player score: 37
  • Position: #68 / 116
  • Number of attempts: 3
Letter case trickery - 1624 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: 11
  • Position: #259 / 517
  • Number of attempts: 4
quotes inside quotes - 3157 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: 16
  • Position: #600 / 1076
  • Number of attempts: 3
Minimalist Limerick - 520 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 38
  • Position: #119 / 174
  • Number of attempts: 2
Prefixes and suffixes - 629 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 28
  • Position: #126 / 196
  • Number of attempts: 2
The name of the game - 665 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #183 / 360
  • Number of attempts: 1
lamb had a little Mary - 599 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 34
  • Position: #76 / 166
  • Number of attempts: 3
SFD-ROC: vimvimvim - 1606 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 9
  • Position: #214 / 446
  • Number of attempts: 5
Stairs Indenting - 473 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #122 / 197
  • Number of attempts: 1
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: 30
  • Position: #386 / 479
  • Number of attempts: 3
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #266 / 445
  • Number of attempts: 1
Vertical Limit - 2538 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 21
  • Position: #32 / 754
  • Number of attempts: 4
Exchanging Quotes - 854 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 34
  • Position: #85 / 229
  • Number of attempts: 3
replacing each line of a block selection - 2998 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 19
  • Position: #173 / 776
  • Number of attempts: 4
Switch function arguments - 2123 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #106 / 658
  • Number of attempts: 4
Append semicolon after expressions - 1046 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #81 / 413
  • Number of attempts: 5
Remove noise from HTTP log - 717 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Position: #94 / 273
  • Number of attempts: 4
switch variable - 5068 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #837 / 1747
  • Number of attempts: 1
The meaning - 574 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #242 / 362
  • Number of attempts: 1
Make it more readable - 1988 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 15
  • Position: #283 / 647
  • Number of attempts: 1
remove dupes from array - 1354 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: #243 / 335
  • Number of attempts: 1
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 19
  • Position: #260 / 652
  • Number of attempts: 4
Ruby 1.9 hashes - 1239 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: 13
  • Position: #166 / 405
  • Number of attempts: 2
Shebangs for all - 1989 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: 13
  • Position: #199 / 513
  • Number of attempts: 7
A Simple One - 1045 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: #396 / 660
  • Number of attempts: 1
Reverse Simple Deletion - 847 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 13
  • Position: #387 / 458
  • Number of attempts: 1
The Cake is a Lie - 1330 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #194 / 523
  • Number of attempts: 4
Make Fancy Header - 1046 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #93 / 343
  • Number of attempts: 4
Change the content of a string - 1561 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #148 / 583
  • Number of attempts: 2
Sort and add attributes - 1431 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #186 / 556
  • Number of attempts: 2
Reconstruct the Sentence - 1484 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

  • Best score: 20
  • Best player score: 23
  • Position: #284 / 408
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3591 entries

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

  • Best score: 16
  • Best player score: 21
  • Position: #229 / 776
  • Number of attempts: 8
Flodder-challenge - 1226 entries

Replace the text the most efficient and win!

  • Best score: 27
  • Best player score: 34
  • Position: #125 / 330
  • Number of attempts: 3
Simple text editing with Vim - 12712 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1351 / 3671
  • Number of attempts: 3
eBrnd
Twitter:

Gefahr! Gefahr!

entered into 63 challenges

contributed 0 challenges