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 - 33616 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 / 7420
  • Number of attempts: 10
Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Position: #657 / 1268
  • Number of attempts: 3
One number per line - 18727 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1046 / 3864
  • Number of attempts: 4
V to the i - 4802 entries

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

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

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

  • Best score: 13
  • Best player score: 15
  • Position: #446 / 753
  • Number of attempts: 2
Search and Replace 0 - 4989 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #842 / 1624
  • Number of attempts: 3
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

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

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 39
  • Position: #82 / 273
  • Number of attempts: 2
Add to end of each line... kinda - 333 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 / 174
  • Number of attempts: 2
underscore_to_camelCase - 173 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: #35 / 82
  • Number of attempts: 2
Fun With The Diagonal - 107 entries

change the lowercase characters on the main diagonal to uppercase

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

Little role switching.

  • Best score: 12
  • Best player score: 16
  • Position: #1218 / 2128
  • Number of attempts: 1
Free hyphen! - 169 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: #53 / 89
  • Number of attempts: 1
Sorting a glossary - 131 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 / 81
  • Number of attempts: 1
comments galore - 1045 entries

Basic comment reformatting

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

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

  • Best score: 11
  • Best player score: 12
  • Position: #22 / 82
  • Number of attempts: 2
Scrambled numbers - 807 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 23
  • Position: #76 / 184
  • Number of attempts: 1
Align commas - 1095 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: #150 / 246
  • Number of attempts: 1
ASCII Art - 87 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Position: #14 / 54
  • Number of attempts: 2
No naked if allowed! - 39 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: #17 / 17
  • Number of attempts: 1
From A to B - 591 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Position: #61 / 159
  • Number of attempts: 4
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 16
  • Position: #812 / 1190
  • Number of attempts: 1
Space out the alphabet - 1657 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 19
  • Position: #251 / 444
  • Number of attempts: 1
Fix the XML - 1039 entries

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

  • Best score: 18
  • Best player score: 24
  • Position: #138 / 290
  • Number of attempts: 3
50 factorials mod 97 - 58 entries

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

  • Best score: 28
  • Best player score: 34
  • Position: #16 / 20
  • Number of attempts: 2
Happy TvvO - 427 entries

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

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

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #2852 / 4180
  • Number of attempts: 1
Don't know what this is - 2022 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: #344 / 585
  • Number of attempts: 3
Where should I put the Newline? - 881 entries

Help me put the newline.

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

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 27
  • Position: #169 / 250
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #921 / 3683
  • Number of attempts: 2
quotes inside quotes - 3159 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: #628 / 1078
  • Number of attempts: 1
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1524 / 3963
  • Number of attempts: 4
The name of the game - 665 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Position: #209 / 360
  • Number of attempts: 1
Saving the hashes(#) - 2063 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: #202 / 480
  • Number of attempts: 3
SFD-ROC: ROT13 Phonics - 101 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 / 73
  • Number of attempts: 1
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #496 / 663
  • Number of attempts: 1
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1187 / 1748
  • Number of attempts: 1
remove dupes from array - 1358 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: #232 / 336
  • Number of attempts: 1
The holy-grail may help - 366 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #143 / 209
  • Number of attempts: 1
A Simple One - 1050 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 / 664
  • Number of attempts: 1
The Cake is a Lie - 1346 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #373 / 527
  • Number of attempts: 2
Reformat some Python - 609 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 42
  • Position: #120 / 236
  • Number of attempts: 2
Sort and add attributes - 1451 entries

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

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

entered into 44 challenges

contributed 0 challenges