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

Presidential Sorting - 45 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
  • Number of attempts: 1
Sort and add attributes - 1090 entries

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

  • Best score: 33
  • Best player score: 34
  • Number of attempts: 3
Two become one - 676 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
  • Number of attempts: 10
Basic renumbering - 4690 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 21
  • Number of attempts: 2
range(10) digit rotation - 32 entries

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

  • Best score: 18
  • Best player score: 21
  • Number of attempts: 1
Reconstruct the Sentence - 1028 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
  • Number of attempts: 8
Line 'em up! - 275 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
  • Number of attempts: 4
Remove noise from HTTP log - 611 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
  • Number of attempts: 4
Every other line - 2138 entries

AaAaAaA

  • Best score: 12
  • Best player score: 15
  • Number of attempts: 5
Simple, Practical, and Common - 25746 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
  • Number of attempts: 8
Assignment Alignment - 695 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 20
  • Number of attempts: 1
Fiddle percentages into real numbers - 724 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
  • Number of attempts: 4
The Quick Brown Fox Jumps Over The Lazy Vim - 330 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: 10
  • Best player score: 11
  • Number of attempts: 1
maximun and minimun - 44 entries

Find the maximum and minimum of the rows.

  • Best score: 51
  • Best player score: 71
  • Number of attempts: 1
Simple Maths - 30 entries

Not much to say, discover by yourself!

  • Best score: 26
  • Best player score: 47
  • Number of attempts: 1
Order and join - 756 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 4
replacing each line of a block selection - 2545 entries

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

  • Best score: 18
  • Best player score: 27
  • Number of attempts: 3
comment and uncomment code inline - 826 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
  • Number of attempts: 1
Swap assigned value - 499 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 2
Swap values - 3628 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 5
Words in parens - 11183 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 7
A Simple One - 845 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
  • Number of attempts: 2
I forgot quotes - 12173 entries

Oops.

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 7
7th Birthday - 163 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
  • Number of attempts: 1
A simple change - 362 entries

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

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 1
Just the middle - 9428 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Braces or Brackets? - 626 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 38
  • Number of attempts: 6
The meaning - 502 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Change the content of a string - 1238 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 23
  • Number of attempts: 1
Remove semicolons after expressions - 460 entries

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

  • Best score: 6
  • Best player score: 8
  • Number of attempts: 1
Collect List - 3553 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 5
The Cake is a Lie - 1127 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 2
Adam's challenge - 804 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
  • Number of attempts: 5
Simple text editing with Vim - 10544 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
V to the i - 3977 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 4
That hyphen - 2205 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 11
  • Number of attempts: 5
Vertical Limit - 2126 entries

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

  • Best score: 21
  • Best player score: 39
  • Number of attempts: 1
Gray area - 645 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 5
Shuffled numbers - 199 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
  • Number of attempts: 1
Search and Replace 0 - 4170 entries

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

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 4
Switch function arguments - 1843 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 2
Vice versa - 6071 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 8
vim = 22 / 7 - 398 entries

pi square vim

  • Best score: 20
  • Best player score: 21
  • Number of attempts: 9
-a-b-c- - 2637 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 5
Copy three lines - 2136 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 9
One number per line - 13418 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 11
jakeroberts
Twitter:

entered into 46 challenges

contributed 0 challenges