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 - 26150 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: 14
  • Best player score: 27
  • Number of attempts: 2
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
Condensed Cases - 695 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 3
One number per line - 13706 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Number of attempts: 6
Simple text editing with Vim - 10592 entries

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

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 4
Collect List - 3575 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 3
Let's play some Ivmgolf - 926 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Number of attempts: 1
Copy three lines - 2208 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: 4
Shebangs for all - 1618 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: 12
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 9653 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Search and Replace 0 - 4187 entries

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

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 3
Every other line - 2197 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 5
Don't know what this is - 1787 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: 12
  • Number of attempts: 3
Extract argument from function - 2037 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
Generate a list of numbers - 250 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 1
Space out the alphabet - 1401 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 4
switch variable - 4382 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
replace 2nd column blanks with values in same column if blank - 183 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

  • Best score: 15
  • Best player score: 17
  • 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: 2
quotes inside quotes - 2826 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: 17
  • Number of attempts: 1
From A to B - 496 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 2
replacing each line of a block selection - 2569 entries

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

  • Best score: 18
  • Best player score: 19
  • Number of attempts: 4
Saving the hashes(#) - 1770 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: 21
  • Number of attempts: 6
Vertical Limit - 2148 entries

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

  • Best score: 21
  • Best player score: 22
  • Number of attempts: 3
Alex Linden
Twitter:

entered into 24 challenges

contributed 0 challenges