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

HS exam question - 1510 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 59
  • Position: #105 / 397
  • Number of attempts: 1
delete swap - 1527 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #105 / 480
  • Number of attempts: 1
hello-world-vimgolf - 2361 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #206 / 667
  • Number of attempts: 5
Simple, Practical, and Common - 33385 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: #913 / 7364
  • Number of attempts: 5
Swap values - 4543 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Position: #709 / 1257
  • Number of attempts: 3
V to the i - 4751 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #480 / 1879
  • Number of attempts: 4
Box it - 7828 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #112 / 1865
  • Number of attempts: 3
From argument to object - 1474 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 21
  • Position: #363 / 450
  • Number of attempts: 1
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 13
  • Position: #189 / 700
  • Number of attempts: 6
Copy three lines - 2840 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 15
  • Position: #220 / 635
  • Number of attempts: 6
Search and Replace 0 - 4792 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #485 / 1585
  • Number of attempts: 6
comment and uncomment code inline - 1069 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 17
  • Position: #286 / 314
  • Number of attempts: 1
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2419 / 4164
  • Number of attempts: 2
Team names - 1805 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #51 / 581
  • Number of attempts: 3
Learn some german verbs - 531 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 26
  • Position: #74 / 131
  • Number of attempts: 1
Todo list specification - 385 entries

The every item on the todo list must be done today. Modify the list to reflect that.

  • Best score: 37
  • Best player score: 39
  • Position: #130 / 176
  • Number of attempts: 3
Stairstep digits - 376 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 13
  • Position: #97 / 141
  • Number of attempts: 1
Format java properties - 72 entries

Format java properties to a different format. The value which is the string following the first '=' cannot & should not change. All periods in the key get replaced with an underscore "_" and get a prefix of "b_".

  • Best score: 27
  • Best player score: 37
  • Position: #25 / 33
  • Number of attempts: 3
Fiddle percentages into real numbers - 840 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 18
  • Position: #236 / 287
  • Number of attempts: 1
Nesting SASS - 261 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 20
  • Position: #85 / 93
  • Number of attempts: 1
Wrap text in quotes - 349 entries

All the blocks of text should be wrapped in quotation marks.

  • Best score: 16
  • Best player score: 16
  • Position: #31 / 120
  • Number of attempts: 4
Fun With The Diagonal - 103 entries

change the lowercase characters on the main diagonal to uppercase

  • Best score: 11
  • Best player score: 11
  • Position: #46 / 79
  • Number of attempts: 2
Pretty multi-line bash - 218 entries

Bash line continuations are much prettier when they're column aligned.

  • Best score: 15
  • Best player score: 15
  • Position: #25 / 75
  • Number of attempts: 7
comments galore - 998 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #222 / 418
  • Number of attempts: 3
Change attribute to getter - 133 entries

Wrap attributes with a getter method.

  • Best score: 24
  • Best player score: 24
  • Position: #20 / 57
  • Number of attempts: 3
Scrambled numbers - 779 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 20
  • Position: #68 / 182
  • Number of attempts: 8
Line under headers - 2004 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 33
  • Position: #337 / 496
  • Number of attempts: 1
Join 'em - 248 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 5
  • Position: #47 / 148
  • Number of attempts: 2
Array transposition - 2378 entries

Transpose two arrays into one.

  • Best score: 16
  • Best player score: 27
  • Position: #321 / 443
  • Number of attempts: 1
Mirror Symmetry - 798 entries

Add backslashes.

  • Best score: 7
  • Best player score: 10
  • Position: #110 / 266
  • Number of attempts: 4
Collect List - 4264 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #302 / 1186
  • Number of attempts: 6
Space out the alphabet - 1627 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 18
  • Position: #225 / 440
  • Number of attempts: 7
I forgot quotes - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 16
  • Position: #2683 / 4161
  • Number of attempts: 1
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Position: #974 / 1129
  • Number of attempts: 2
Do you demand a shrubbery? - 1120 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 15
  • Position: #58 / 293
  • Number of attempts: 11
Where should I put the Newline? - 863 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #189 / 431
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 10628 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2315 / 3667
  • Number of attempts: 1
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1665 / 3946
  • Number of attempts: 2
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: 28
  • Position: #294 / 473
  • Number of attempts: 2
Ruby 1.9 hashes - 1221 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: #81 / 401
  • Number of attempts: 6
Context insensitive completion 0 - 507 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

  • Best score: 6
  • Best player score: 7
  • Position: #96 / 232
  • Number of attempts: 3
James Houghton
Twitter:

entered into 41 challenges

contributed 0 challenges