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

Transposition - 66 entries

Transpose the original lines in separate columns, one for each line.

  • Best score: 31
  • Best player score: 97
  • Number of attempts: 1
lamb had a little Mary - 450 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 32
  • Number of attempts: 4
quotes inside quotes - 2654 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: 2
  • Best player score: 31
  • Number of attempts: 1
Search and Replace 0 - 3875 entries

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

  • Best score: 12
  • Best player score: 14
  • Number of attempts: 4
Prefixes and suffixes - 465 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 42
  • Number of attempts: 2
Append semicolon after expressions - 838 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 6
switch variable - 4135 entries

how fast can you switch two variable ?

  • Best score: 3
  • Best player score: 12
  • Number of attempts: 4
Reverse Simple Deletion - 694 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 1
Increment, increment, increment.... - 472 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Number of attempts: 2
comments galore - 873 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 11
  • Number of attempts: 1
Swap assigned value - 485 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 13
  • Number of attempts: 4
Swap values - 3230 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 6
Wrap the text of an email message to 79 characters - 478 entries

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

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 2
Braces or Brackets? - 618 entries

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

  • Best score: 34
  • Best player score: 65
  • Number of attempts: 2
The meaning - 489 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Number of attempts: 1
Remove semicolons after expressions - 432 entries

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

  • Best score: 6
  • Best player score: 6
  • Number of attempts: 3
Words in parens - 10462 entries

We should all ace this, right?

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

Oops.

  • Best score: 10
  • Best player score: 16
  • Number of attempts: 4
Enumerate words - 219 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 28
  • Number of attempts: 2
Simple text editing with Vim - 10005 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: 14
The name of the game - 574 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 2
Groups magic - 134 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 3
abcd > a b c d - 238 entries

transform the single spaces into 4 spaces repeat for each line

  • Best score: 15
  • Best player score: 15
  • Number of attempts: 1
Fix the XML - 836 entries

The challenge consists in having a valid xml from an incomplete source.

  • Best score: 18
  • Best player score: 24
  • Number of attempts: 8
Simple, Practical, and Common - 21763 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: 2
  • Best player score: 25
  • Number of attempts: 8
Collect List - 3205 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 26
  • Number of attempts: 4

Contributed Challenges

quotes inside quotes - 2654 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 :)

Global Maquereau
Twitter:

entered into 27 challenges

contributed 1 challenges