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 - 33385 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: 28
  • Position: #4204 / 7364
  • Number of attempts: 8
Swap values - 4543 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #165 / 1257
  • Number of attempts: 5
One number per line - 18616 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #222 / 3842
  • Number of attempts: 11
vim = 22 / 7 - 447 entries

pi square vim

  • Best score: 20
  • Best player score: 21
  • Position: #48 / 131
  • Number of attempts: 9
V to the i - 4751 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #488 / 1879
  • Number of attempts: 4
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 15
  • Position: #330 / 700
  • Number of attempts: 5
Copy three lines - 2840 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 13
  • Position: #66 / 635
  • Number of attempts: 9
Search and Replace 0 - 4792 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #832 / 1585
  • Number of attempts: 4
That hyphen - 2556 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Position: #349 / 695
  • Number of attempts: 5
comment and uncomment code inline - 1069 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 12
  • Position: #226 / 314
  • Number of attempts: 1
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #897 / 4164
  • Number of attempts: 3
Basic renumbering - 5587 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Position: #911 / 1258
  • Number of attempts: 2
Adam's challenge - 957 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 20
  • Position: #129 / 266
  • Number of attempts: 5
Fiddle percentages into real numbers - 840 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 14
  • Position: #176 / 287
  • Number of attempts: 4
Vice versa - 7805 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #280 / 2101
  • Number of attempts: 8
7th Birthday - 186 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

  • Best score: 19
  • Best player score: 22
  • Position: #30 / 73
  • Number of attempts: 1
Order and join - 956 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #110 / 255
  • Number of attempts: 4
Swap assigned value - 626 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #177 / 250
  • Number of attempts: 2
Collect List - 4264 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 13
  • Position: #568 / 1186
  • Number of attempts: 5
Line 'em up! - 392 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 18
  • Position: #48 / 110
  • Number of attempts: 4
Shuffled numbers - 234 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

  • Best score: 15
  • Best player score: 17
  • Position: #77 / 93
  • Number of attempts: 1
Simple Maths - 45 entries

Not much to say, discover by yourself!

  • Best score: 26
  • Best player score: 47
  • Position: #23 / 25
  • Number of attempts: 1
range(10) digit rotation - 32 entries

This is a data generator challenge or some kind of gift..

  • Best score: 18
  • Best player score: 21
  • Position: #19 / 20
  • Number of attempts: 1
I forgot quotes - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 12
  • Position: #1316 / 4161
  • Number of attempts: 7
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #205 / 1129
  • Number of attempts: 5
Gray area - 732 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #102 / 268
  • Number of attempts: 5
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: 28
  • Position: #69 / 205
  • Number of attempts: 10
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1578 / 3946
  • Number of attempts: 7
A simple change - 442 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 16
  • Position: #160 / 189
  • Number of attempts: 1
Presidential Sorting - 48 entries

Given a nice CSV formatted arrangement of the Presidents of the United States, we need to print out an alphabetical list in pretty columns. Prove that vim can conquer this basic Excel task!

  • Best score: 40
  • Best player score: 44
  • Position: #4 / 23
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 401 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: 11
  • Position: #102 / 188
  • Number of attempts: 1
maximun and minimun - 58 entries

Find the maximum and minimum of the rows.

  • Best score: 51
  • Best player score: 71
  • Position: #19 / 24
  • Number of attempts: 1
Vertical Limit - 2448 entries

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

  • Best score: 21
  • Best player score: 39
  • Position: #717 / 738
  • Number of attempts: 1
replacing each line of a block selection - 2947 entries

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

  • Best score: 18
  • Best player score: 27
  • Position: #572 / 768
  • Number of attempts: 3
Switch function arguments - 2082 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #442 / 652
  • Number of attempts: 2
Remove noise from HTTP log - 695 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: 16
  • Position: #158 / 270
  • Number of attempts: 4
Remove semicolons after expressions - 628 entries

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

  • Best score: 6
  • Best player score: 8
  • Position: #183 / 258
  • Number of attempts: 1
The meaning - 558 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #141 / 356
  • Number of attempts: 1
Assignment Alignment - 832 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 20
  • Position: #87 / 215
  • 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: #449 / 643
  • Number of attempts: 2
The Cake is a Lie - 1286 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #371 / 512
  • Number of attempts: 2
Change the content of a string - 1476 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #282 / 558
  • Number of attempts: 1
Sort and add attributes - 1327 entries

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

  • Best score: 33
  • Best player score: 34
  • Position: #343 / 529
  • Number of attempts: 3
Reconstruct the Sentence - 1369 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: 20
  • Position: #101 / 384
  • Number of attempts: 8
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: 38
  • Position: #67 / 288
  • Number of attempts: 6
Simple text editing with Vim - 12290 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1560 / 3581
  • Number of attempts: 3
jakeroberts
Twitter:

entered into 46 challenges

contributed 0 challenges