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: 23
  • Position: #2596 / 7358
  • Number of attempts: 8
Swap values - 4535 entries

Well, swap the values...

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

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Position: #838 / 3841
  • Number of attempts: 5
multiple cursor alternative - 1474 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 21
  • Position: #207 / 376
  • Number of attempts: 2
Copy three lines - 2839 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #59 / 634
  • Number of attempts: 8
Just the middle - 11346 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2411 / 4160
  • Number of attempts: 2
Make HTML List - 1039 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 46
  • Position: #137 / 271
  • Number of attempts: 2
Un"finnish"ed Work - 107 entries

Replace å by a, ä by a and ö by o.

  • Best score: 14
  • Best player score: 15
  • Position: #34 / 56
  • Number of attempts: 3
Simple addition - 307 entries

The right side of the equation is already there. We just need the left one now.

  • Best score: 12
  • Best player score: 13
  • Position: #66 / 116
  • Number of attempts: 1
Adam's challenge - 950 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

  • Best score: 18
  • Best player score: 18
  • Position: #11 / 265
  • Number of attempts: 4
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: 13
  • Position: #53 / 287
  • Number of attempts: 3
Nesting SASS - 261 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 9
  • Position: #13 / 93
  • Number of attempts: 4
replace 2nd column blanks with values in same column if blank - 231 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

  • Best score: 15
  • Best player score: 18
  • Position: #63 / 81
  • Number of attempts: 1
Vice versa - 7778 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #278 / 2095
  • Number of attempts: 3
Paragraph breaks - 505 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 13
  • Position: #130 / 165
  • Number of attempts: 2
Replace and keep the case - 407 entries

Replace all instance of plugin and Plugin to device and Device.

  • Best score: 26
  • Best player score: 26
  • Position: #40 / 115
  • Number of attempts: 4
Scrambled numbers - 779 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 18
  • Position: #23 / 182
  • Number of attempts: 5
From A to B - 564 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Position: #86 / 155
  • Number of attempts: 4
Space out the alphabet - 1627 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Position: #190 / 440
  • Number of attempts: 2
Fix the XML - 996 entries

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

  • Best score: 18
  • Best player score: 20
  • Position: #82 / 284
  • Number of attempts: 7
Line 'em up! - 392 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 19
  • Position: #62 / 110
  • Number of attempts: 5
Mute the second method of this script - 447 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Position: #121 / 237
  • Number of attempts: 1
I forgot quotes - 15923 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #562 / 4159
  • Number of attempts: 5
Two become one - 710 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 25
  • Position: #3 / 205
  • Number of attempts: 9
A HAPPY NEW YEAR 2014 ! - 10616 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1125 / 3663
  • Number of attempts: 4
Letter case trickery - 1594 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 10
  • Position: #154 / 511
  • Number of attempts: 4
Words in parens - 12850 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2354 / 3944
  • Number of attempts: 3
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: 25
  • Position: #180 / 473
  • Number of attempts: 7
Let's play some Ivmgolf - 1084 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #107 / 440
  • Number of attempts: 2
Vertical Limit - 2436 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 25
  • Position: #366 / 735
  • Number of attempts: 1
Exchanging Quotes - 820 entries

Sometimes you need to exchange a choice of quotes in some code.

  • Best score: 30
  • Best player score: 37
  • Position: #133 / 224
  • 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: 17
  • Position: #69 / 330
  • Number of attempts: 18
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: #450 / 641
  • Number of attempts: 2
The Cake is a Lie - 1284 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #233 / 511
  • Number of attempts: 6
Change the content of a string - 1457 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #167 / 552
  • Number of attempts: 3
Rami Hovi
Twitter:

Lawyer and logician who loves computers and command line. Entrepreneur at Law Office Oikeushovi. #VimUser, @QubesOS enthusiast

entered into 35 challenges

contributed 0 challenges