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 - 33616 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: #4228 / 7420
  • Number of attempts: 8
Swap values - 4616 entries

Well, swap the values...

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

Just give me the numbers.

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

pi square vim

  • Best score: 20
  • Best player score: 21
  • Position: #50 / 135
  • Number of attempts: 9
V to the i - 4802 entries

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

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

AaAaAaA

  • Best score: 12
  • Best player score: 15
  • Position: #332 / 703
  • Number of attempts: 5
Copy three lines - 2872 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 / 640
  • Number of attempts: 9
Search and Replace 0 - 4989 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #857 / 1624
  • Number of attempts: 4
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Position: #353 / 701
  • Number of attempts: 5
comment and uncomment code inline - 1122 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: #233 / 322
  • Number of attempts: 1
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Position: #917 / 1264
  • Number of attempts: 2
Adam's challenge - 984 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: #132 / 270
  • Number of attempts: 5
Fiddle percentages into real numbers - 865 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: #178 / 291
  • Number of attempts: 4
Vice versa - 7907 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #280 / 2128
  • Number of attempts: 8
7th Birthday - 202 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: #32 / 75
  • Number of attempts: 1
Order and join - 983 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Position: #113 / 259
  • Number of attempts: 4
Swap assigned value - 647 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #179 / 254
  • Number of attempts: 2
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 13
  • Position: #571 / 1190
  • Number of attempts: 5
Line 'em up! - 421 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: #50 / 114
  • Number of attempts: 4
Shuffled numbers - 246 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: #80 / 96
  • Number of attempts: 1
Simple Maths - 57 entries

Not much to say, discover by yourself!

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

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

  • Best score: 18
  • Best player score: 21
  • Position: #21 / 22
  • Number of attempts: 1
I forgot quotes - 15983 entries

Oops.

  • Best score: 10
  • Best player score: 12
  • Position: #1319 / 4180
  • Number of attempts: 7
-a-b-c- - 3213 entries

Put hyphens everywhere.

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

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Position: #103 / 271
  • Number of attempts: 5
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: #70 / 208
  • Number of attempts: 10
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1586 / 3963
  • Number of attempts: 7
A simple change - 461 entries

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

  • Best score: 12
  • Best player score: 16
  • Position: #162 / 191
  • Number of attempts: 1
Presidential Sorting - 51 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: #5 / 26
  • Number of attempts: 1
The Quick Brown Fox Jumps Over The Lazy Vim - 420 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: #105 / 192
  • Number of attempts: 1
maximun and minimun - 73 entries

Find the maximum and minimum of the rows.

  • Best score: 50
  • Best player score: 71
  • Position: #21 / 26
  • 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: 39
  • Position: #732 / 754
  • Number of attempts: 1
replacing each line of a block selection - 2999 entries

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

  • Best score: 18
  • Best player score: 27
  • Position: #578 / 777
  • Number of attempts: 3
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #452 / 663
  • Number of attempts: 2
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: 16
  • Position: #161 / 273
  • Number of attempts: 4
Remove semicolons after expressions - 654 entries

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

  • Best score: 6
  • Best player score: 8
  • Position: #188 / 263
  • Number of attempts: 1
The meaning - 575 entries

Numbers are fun!

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

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 20
  • Position: #89 / 220
  • Number of attempts: 1
A Simple One - 1050 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 / 664
  • Number of attempts: 2
The Cake is a Lie - 1346 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #381 / 527
  • Number of attempts: 2
Change the content of a string - 1580 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Position: #301 / 588
  • Number of attempts: 1
Sort and add attributes - 1451 entries

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

  • Best score: 33
  • Best player score: 34
  • Position: #364 / 563
  • Number of attempts: 3
Reconstruct the Sentence - 1507 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 / 412
  • Number of attempts: 8
Braces or Brackets? - 1015 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: #76 / 315
  • Number of attempts: 6
Simple text editing with Vim - 12811 entries

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

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

entered into 46 challenges

contributed 0 challenges