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

No naked if allowed! - 23 entries

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

  • Best score: 43
  • Best player score: 81
  • Number of attempts: 1
Reformat some Python - 511 entries

Fix some very bizarrely laid-out code.

  • Best score: 34
  • Best player score: 42
  • Number of attempts: 2
Make HTML List - 917 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 39
  • Number of attempts: 2
Mess in revision history - 1008 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 27
  • Number of attempts: 1
remove dupes from array - 1231 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
  • Number of attempts: 1
Scrambled numbers - 753 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 23
  • Number of attempts: 1
Space out the alphabet - 1413 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 19
  • Number of attempts: 1
One number per line - 14214 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Number of attempts: 4
I forgot quotes - 12736 entries

Oops.

  • Best score: 10
  • Best player score: 17
  • Number of attempts: 1
Vice versa - 6249 entries

Little role switching.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 1
quotes inside quotes - 2834 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
  • Number of attempts: 1
The holy-grail may help - 301 entries

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

  • Best score: 16
  • Best player score: 16
  • Number of attempts: 1
Saving the hashes(#) - 1806 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
  • Number of attempts: 3
underscore_to_camelCase - 139 entries

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

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 2
The name of the game - 587 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Sorting a glossary - 101 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
  • Number of attempts: 1
Just the middle - 9690 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
Words in parens - 11376 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 15
  • Number of attempts: 4
A Simple One - 849 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: 1
From A to B - 507 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Number of attempts: 4
SFD-ROC: ROT13 Phonics - 70 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
  • Number of attempts: 1
comments galore - 910 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Swap values - 3773 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 3
Where should I put the Newline? - 803 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 2
Collect List - 3621 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 16
  • Number of attempts: 1
The Cake is a Lie - 1140 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Number of attempts: 2
V to the i - 4122 entries

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

  • Best score: 7
  • Best player score: 7
  • Number of attempts: 3
switch variable - 4443 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Number of attempts: 1
50 factorials mod 97 - 24 entries

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

  • Best score: 28
  • Best player score: 34
  • Number of attempts: 2
Free hyphen! - 117 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
  • Number of attempts: 1
Sort and add attributes - 1099 entries

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

  • Best score: 33
  • Best player score: 35
  • Number of attempts: 2
Align commas - 882 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
  • Number of attempts: 1
Fun With The Diagonal - 86 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 1
Fix the XML - 895 entries

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

  • Best score: 18
  • Best player score: 24
  • Number of attempts: 3
Simple, Practical, and Common - 26840 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
  • Number of attempts: 10
ASCII Art - 76 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 10
  • Number of attempts: 2
Happy TvvO - 357 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Add to end of each line... kinda - 265 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
  • Number of attempts: 2
Inner hyphens - 114 entries

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

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 9730 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 2
Search and Replace 0 - 4210 entries

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

  • Best score: 12
  • Best player score: 13
  • Number of attempts: 3
Switch function arguments - 1852 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Number of attempts: 1
Extract argument from function - 2049 entries

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

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 2
Don't know what this is - 1805 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
  • Number of attempts: 3
glepha
Twitter:

entered into 44 challenges

contributed 0 challenges