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

V to the i - 4813 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #191 / 1897
  • Number of attempts: 4
Wrap the text of an email message to 79 characters - 799 entries

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

  • Best score: 5
  • Best player score: 6
  • Position: #364 / 421
  • Number of attempts: 1
Search and Replace 0 - 5004 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #385 / 1630
  • Number of attempts: 7
Just the middle - 11483 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #163 / 4209
  • Number of attempts: 5
Basic renumbering - 5683 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 19
  • Position: #738 / 1269
  • Number of attempts: 6
Join 'em - 251 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 5
  • Position: #54 / 151
  • Number of attempts: 2
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 17
  • Position: #162 / 281
  • Number of attempts: 2
Space out the alphabet - 1658 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 15
  • Position: #17 / 445
  • Number of attempts: 5
Fix the XML - 1039 entries

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

  • Best score: 18
  • Best player score: 18
  • Position: #12 / 290
  • Number of attempts: 7
Mute the second method of this script - 455 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 9
  • Position: #74 / 239
  • Number of attempts: 4
Condensed Cases - 804 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: 12
  • Position: #28 / 247
  • Number of attempts: 8
I forgot quotes - 16022 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1527 / 4189
  • Number of attempts: 7
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #86 / 1138
  • Number of attempts: 2
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 15
  • Position: #106 / 354
  • Number of attempts: 3
Do you demand a shrubbery? - 1158 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 32
  • Position: #264 / 300
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10682 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #658 / 3689
  • Number of attempts: 4
quotes inside quotes - 3165 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: 14
  • Position: #195 / 1079
  • Number of attempts: 6
Words in parens - 12967 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #523 / 3969
  • Number of attempts: 5
replacing each line of a block selection - 3001 entries

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

  • Best score: 18
  • Best player score: 20
  • Position: #286 / 778
  • Number of attempts: 6
Remove semicolons after expressions - 654 entries

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

  • Best score: 6
  • Best player score: 7
  • Position: #143 / 263
  • Number of attempts: 6
switch variable - 5079 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #557 / 1749
  • Number of attempts: 8
Sort the cardinal numbers - 315 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 13
  • Position: #65 / 149
  • Number of attempts: 2
Ruby 1.9 hashes - 1249 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

  • Best score: 12
  • Best player score: 12
  • Position: #93 / 407
  • Number of attempts: 6
A Simple One - 1057 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: #496 / 667
  • Number of attempts: 1
Increment, increment, increment.... - 692 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #356 / 410
  • Number of attempts: 3
Reformat some Python - 622 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 47
  • Position: #167 / 238
  • Number of attempts: 1
Change the content of a string - 1593 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 24
  • Position: #347 / 594
  • Number of attempts: 3
Sort and add attributes - 1477 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #222 / 575
  • Number of attempts: 4
Simple text editing with Vim - 12983 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1421 / 3736
  • Number of attempts: 3
Sigurður Ægir Jónsso
Twitter:

entered into 29 challenges

contributed 0 challenges