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 - 33535 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: #2605 / 7397
  • Number of attempts: 8
Swap values - 4600 entries

Well, swap the values...

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

Just give me the numbers.

  • Best score: 14
  • Best player score: 16
  • Position: #844 / 3855
  • Number of attempts: 5
multiple cursor alternative - 1519 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: #210 / 380
  • Number of attempts: 2
Copy three lines - 2872 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 / 640
  • Number of attempts: 8
Just the middle - 11417 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2416 / 4181
  • Number of attempts: 2
Make HTML List - 1050 entries

Turn the comma separated list into an unordered html list.

  • Best score: 33
  • Best player score: 46
  • Position: #139 / 273
  • Number of attempts: 2
Un"finnish"ed Work - 116 entries

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

  • Best score: 14
  • Best player score: 15
  • Position: #36 / 60
  • Number of attempts: 3
Simple addition - 323 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: #68 / 120
  • Number of attempts: 1
Adam's challenge - 978 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 / 268
  • Number of attempts: 4
Fiddle percentages into real numbers - 862 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 / 289
  • Number of attempts: 3
Nesting SASS - 265 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 9
  • Position: #13 / 95
  • Number of attempts: 4
replace 2nd column blanks with values in same column if blank - 242 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: #65 / 83
  • Number of attempts: 1
Vice versa - 7891 entries

Little role switching.

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

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 13
  • Position: #132 / 167
  • Number of attempts: 2
Replace and keep the case - 437 entries

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

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

Four is NOT 1. One is 1.

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

Mirror and change this text block

  • Best score: 16
  • Best player score: 17
  • Position: #89 / 159
  • Number of attempts: 4
Space out the alphabet - 1657 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Position: #192 / 444
  • Number of attempts: 2
Fix the XML - 1035 entries

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

  • Best score: 18
  • Best player score: 20
  • Position: #84 / 289
  • Number of attempts: 7
Line 'em up! - 420 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: #64 / 113
  • Number of attempts: 5
Mute the second method of this script - 455 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 9
  • Position: #122 / 239
  • Number of attempts: 1
I forgot quotes - 15954 entries

Oops.

  • Best score: 10
  • Best player score: 10
  • Position: #562 / 4170
  • Number of attempts: 5
Two become one - 713 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 / 208
  • Number of attempts: 9
A HAPPY NEW YEAR 2014 ! - 10654 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #1125 / 3678
  • Number of attempts: 4
Letter case trickery - 1619 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: #156 / 515
  • Number of attempts: 4
Words in parens - 12918 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2362 / 3957
  • Number of attempts: 3
Saving the hashes(#) - 2048 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: #182 / 478
  • Number of attempts: 7
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

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

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

  • Best score: 21
  • Best player score: 25
  • Position: #373 / 751
  • Number of attempts: 1
Exchanging Quotes - 851 entries

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

  • Best score: 30
  • Best player score: 37
  • Position: #135 / 228
  • Number of attempts: 1
remove dupes from array - 1347 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 / 334
  • Number of attempts: 18
A Simple One - 1037 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 / 657
  • Number of attempts: 2
The Cake is a Lie - 1324 entries

Correct the capitalization of each word

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

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #167 / 577
  • 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