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

Simple, Practical, and Common - 33757 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 22
  • Position: #411 / 7450
  • Number of attempts: 7
Prime Numbers - 385 entries

List the first 100 prime numbers.

  • Best score: 34
  • Best player score: 39
  • Position: #14 / 107
  • Number of attempts: 2
Wrap the text of an email message to 79 characters - 814 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #125 / 426
  • Number of attempts: 1
Just the middle - 11500 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #546 / 4216
  • Number of attempts: 3
comments galore - 1069 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #55 / 428
  • Number of attempts: 2
lipsum lines - 278 entries

Convert a quoted block of text into strings in a list.

  • Best score: 28
  • Best player score: 36
  • Position: #76 / 95
  • Number of attempts: 2
Square numbers - 123 entries

Boring math puzzle.

  • Best score: 16
  • Best player score: 25
  • Position: #17 / 42
  • Number of attempts: 3
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #139 / 1138
  • Number of attempts: 5
Don't know what this is - 2024 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: 11
  • Position: #56 / 586
  • Number of attempts: 6
Split the words - 372 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: 50
  • Position: #105 / 112
  • Number of attempts: 1
Letter case trickery - 1644 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: #146 / 520
  • Number of attempts: 5
Words in parens - 12969 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #155 / 3970
  • Number of attempts: 4
Harder than "abcd > a b c d" - 106 entries

Not as easy as the last challenge. This time, just one space between a and b, up to 25 spaces between y and z. (Removed some lines; diff was too long.)

  • Best score: 15
  • Best player score: 29
  • Position: #40 / 47
  • Number of attempts: 1
abcd > a b c d - 298 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Position: #7 / 227
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 425 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 10
  • Position: #12 / 193
  • Number of attempts: 2
Cleanining up 80 column concatenated text - 206 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

  • Best score: 31
  • Best player score: 31
  • Position: #4 / 80
  • Number of attempts: 8
Vertical Limit - 2564 entries

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

  • Best score: 21
  • Best player score: 22
  • Position: #128 / 759
  • Number of attempts: 4
Aligning function arguments to match a specific coding style - 259 entries

Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.

  • Best score: 16
  • Best player score: 17
  • Position: #27 / 72
  • Number of attempts: 4
Exchanging Quotes - 859 entries

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

  • Best score: 30
  • Best player score: 31
  • Position: #27 / 231
  • Number of attempts: 8
replacing each line of a block selection - 3005 entries

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

  • Best score: 18
  • Best player score: 30
  • Position: #648 / 779
  • Number of attempts: 2
Switch function arguments - 2152 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #36 / 667
  • Number of attempts: 6
Append semicolon after expressions - 1057 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #25 / 420
  • Number of attempts: 3
Reverse and double space - 500 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 14
  • Position: #36 / 199
  • Number of attempts: 4
Remove noise from HTTP log - 724 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: #47 / 275
  • Number of attempts: 2
Remove semicolons after expressions - 663 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 6
  • Position: #42 / 264
  • Number of attempts: 2
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #125 / 1750
  • Number of attempts: 4
The meaning - 575 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #134 / 363
  • Number of attempts: 1
Sort the cardinal numbers - 315 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 12
  • Position: #31 / 149
  • Number of attempts: 2
Line Zipper - 477 entries

Zip/pair related lines.

  • Best score: 12
  • Best player score: 13
  • Position: #51 / 216
  • Number of attempts: 3
remove dupes from array - 1358 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: 17
  • Position: #41 / 336
  • Number of attempts: 9
Numbering a List - 1939 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 18
  • Position: #118 / 655
  • Number of attempts: 5
The holy-grail may help - 389 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #114 / 215
  • Number of attempts: 1
Ruby 1.9 hashes - 1258 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: #43 / 409
  • Number of attempts: 4
Shebangs for all - 2046 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: 21
  • Position: #434 / 522
  • Number of attempts: 1
Reverse Simple Deletion - 857 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #242 / 461
  • Number of attempts: 2
Sorting paragraphs - 552 entries

Order the paragraphs correctly, per prefixed index

  • Best score: 18
  • Best player score: 18
  • Position: #2 / 165
  • Number of attempts: 9
Reconstruct the Sentence - 1649 entries

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

  • Best score: 19
  • Best player score: 20
  • Position: #62 / 434
  • Number of attempts: 5
Whitespace, empty lines and tabs - 3793 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #72 / 814
  • Number of attempts: 10
Joseph J. Piché
Twitter:

I may or may not be an Android & iOS programmer. I may or may not have studied Philosophy.

entered into 38 challenges

contributed 0 challenges