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 - 33354 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: 22
  • Position: #388 / 7358
  • Number of attempts: 10
Swap values - 4535 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Position: #651 / 1255
  • Number of attempts: 3
One number per line - 18615 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1039 / 3841
  • Number of attempts: 4
V to the i - 4743 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #335 / 1878
  • Number of attempts: 3
Extract argument from function - 2308 entries

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

  • Best score: 13
  • Best player score: 15
  • Position: #440 / 742
  • Number of attempts: 2
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #817 / 1585
  • Number of attempts: 3
Just the middle - 11346 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #591 / 4160
  • Number of attempts: 3
Make HTML List - 1039 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 39
  • Position: #81 / 271
  • Number of attempts: 2
Add to end of each line... kinda - 323 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 12
  • Position: #72 / 170
  • Number of attempts: 2
underscore_to_camelCase - 162 entries

Pointy haired boss decided we need to switch to camelCase. Let's get this over with.

  • Best score: 14
  • Best player score: 15
  • Position: #33 / 80
  • Number of attempts: 2
Fun With The Diagonal - 103 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #24 / 79
  • Number of attempts: 1
Vice versa - 7778 entries

Little role switching.

  • Best score: 12
  • Best player score: 16
  • Position: #1205 / 2095
  • Number of attempts: 1
Free hyphen! - 159 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

  • Best score: 9
  • Best player score: 11
  • Position: #51 / 85
  • Number of attempts: 1
Sorting a glossary - 118 entries

Sort a glossary. Glossary head contains a header phrase ending with ':' and glossary body has multi line text indented with a tab.

  • Best score: 6
  • Best player score: 6
  • Position: #26 / 76
  • Number of attempts: 1
comments galore - 998 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #140 / 418
  • Number of attempts: 2
Inner hyphens - 124 entries

Yet another hyphen challenge. Adding 5 hyphens to a file shouldn't be too hard.

  • Best score: 11
  • Best player score: 12
  • Position: #20 / 77
  • Number of attempts: 2
Scrambled numbers - 779 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 23
  • Position: #74 / 182
  • Number of attempts: 1
Align commas - 1049 entries

There are 15,000 aligning challenges on vimgolf.com, and they're all exactly the same. I hope this one is a little different.

  • Best score: 11
  • Best player score: 17
  • Position: #146 / 241
  • Number of attempts: 1
ASCII Art - 82 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Position: #14 / 52
  • Number of attempts: 2
No naked if allowed! - 25 entries

House style forbids naked condition statements, comments should start with a space character and be on their own line. Good luck!

  • Best score: 46
  • Best player score: 81
  • Position: #14 / 14
  • Number of attempts: 1
From A to B - 564 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Position: #58 / 155
  • Number of attempts: 4
Collect List - 4261 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 16
  • Position: #809 / 1185
  • Number of attempts: 1
Space out the alphabet - 1627 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 19
  • Position: #249 / 440
  • Number of attempts: 1
Fix the XML - 996 entries

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

  • Best score: 18
  • Best player score: 24
  • Position: #136 / 284
  • Number of attempts: 3
50 factorials mod 97 - 47 entries

List 1! to 50!, but give your answer mod 97.

  • Best score: 28
  • Best player score: 34
  • Position: #14 / 18
  • Number of attempts: 2
Happy TvvO - 403 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Position: #110 / 200
  • Number of attempts: 2
I forgot quotes - 15923 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #2841 / 4159
  • Number of attempts: 1
Don't know what this is - 1978 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: 14
  • Position: #340 / 578
  • Number of attempts: 3
Where should I put the Newline? - 859 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #171 / 430
  • Number of attempts: 2
Mess in revision history - 1157 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 27
  • Position: #166 / 245
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10616 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #921 / 3663
  • Number of attempts: 2
quotes inside quotes - 3124 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: 16
  • Position: #625 / 1071
  • Number of attempts: 1
Words in parens - 12850 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1516 / 3944
  • Number of attempts: 4
The name of the game - 646 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #209 / 354
  • Number of attempts: 1
Saving the hashes(#) - 1992 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: 26
  • Position: #198 / 473
  • Number of attempts: 3
SFD-ROC: ROT13 Phonics - 96 entries

A is for apple, b is for ball, etc... This familiar phonics poem has been rotated 13 characters. Make the letter match the word.

  • Best score: 6
  • Best player score: 6
  • Position: #52 / 70
  • Number of attempts: 1
Switch function arguments - 2064 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #483 / 647
  • Number of attempts: 1
switch variable - 5028 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1180 / 1734
  • Number of attempts: 1
remove dupes from array - 1332 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 24
  • Position: #228 / 330
  • Number of attempts: 1
The holy-grail may help - 345 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 16
  • Position: #143 / 205
  • Number of attempts: 1
A Simple One - 996 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: #426 / 641
  • Number of attempts: 1
The Cake is a Lie - 1284 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #363 / 511
  • Number of attempts: 2
Reformat some Python - 579 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 42
  • Position: #115 / 229
  • Number of attempts: 2
Sort and add attributes - 1321 entries

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

  • Best score: 33
  • Best player score: 35
  • Position: #379 / 527
  • Number of attempts: 2
glepha
Twitter:

entered into 44 challenges

contributed 0 challenges