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 - 33724 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: 27
  • Position: #3858 / 7442
  • Number of attempts: 2
Swap values - 4643 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 15
  • Position: #882 / 1274
  • Number of attempts: 2
One number per line - 18755 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 21
  • Position: #2391 / 3870
  • Number of attempts: 5
V to the i - 4813 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #415 / 1897
  • Number of attempts: 5
Split line with dots - 2154 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 17
  • Position: #256 / 635
  • Number of attempts: 2
Every other line - 2915 entries

AaAaAaA

  • Best score: 12
  • Best player score: 18
  • Position: #534 / 704
  • Number of attempts: 1
Copy three lines - 2875 entries

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

  • Best score: 13
  • Best player score: 24
  • Position: #542 / 641
  • Number of attempts: 2
Just the middle - 11484 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #739 / 4209
  • Number of attempts: 4
Basic renumbering - 5683 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 23
  • Position: #1039 / 1269
  • Number of attempts: 2
Fiddle percentages into real numbers - 867 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: 17
  • Position: #212 / 292
  • Number of attempts: 4
Nesting SASS - 266 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 9
  • Position: #19 / 96
  • Number of attempts: 6
JS notation to Immutable.js notation - 186 entries

Now Immutable.js made its way into many frontends. This challenge consists of a typical refactoring that many of us are facing now.

  • Best score: 34
  • Best player score: 41
  • Position: #42 / 63
  • Number of attempts: 4
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: 13
  • Position: #143 / 174
  • 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: #42 / 81
  • Number of attempts: 1
Paragraph sort - 450 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

  • Best score: 14
  • Best player score: 18
  • Position: #87 / 125
  • Number of attempts: 1
comments galore - 1048 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 11
  • Position: #356 / 425
  • 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: #62 / 82
  • 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: 19
  • Position: #204 / 246
  • Number of attempts: 1
Generate a list of numbers - 295 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 15
  • Position: #97 / 140
  • Number of attempts: 1
ASCII Art - 87 entries

how good are you with simple regex?

  • Best score: 10
  • Best player score: 15
  • Position: #47 / 54
  • Number of attempts: 1
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 14
  • Position: #241 / 269
  • Number of attempts: 2
Collect List - 4305 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 15
  • Position: #721 / 1191
  • Number of attempts: 3
VimGolfNight - 566 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #243 / 348
  • Number of attempts: 1
camel riding - 793 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 19
  • Position: #254 / 281
  • Number of attempts: 2
ASCII box - 347 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 30
  • Position: #94 / 107
  • Number of attempts: 2
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: 10
  • Position: #210 / 239
  • Number of attempts: 1
Condensed Cases - 804 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

  • Best score: 12
  • Best player score: 17
  • Position: #202 / 247
  • 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: #119 / 206
  • Number of attempts: 1
I forgot quotes - 16022 entries

Oops.

  • Best score: 10
  • Best player score: 12
  • Position: #1321 / 4189
  • Number of attempts: 5
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #640 / 1138
  • Number of attempts: 3
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #258 / 354
  • Number of attempts: 1
120 Degrees - 493 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 21
  • Position: #93 / 145
  • Number of attempts: 1
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 14
  • Position: #226 / 271
  • Number of attempts: 1
Do you demand a shrubbery? - 1158 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 30
  • Position: #213 / 300
  • Number of attempts: 2
Don't know what this is - 2024 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: 15
  • Position: #406 / 586
  • Number of attempts: 1
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #182 / 437
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10682 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2140 / 3689
  • Number of attempts: 1
Letter case trickery - 1630 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: 11
  • Position: #285 / 518
  • Number of attempts: 1
quotes inside quotes - 3165 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: 17
  • Position: #891 / 1079
  • Number of attempts: 1
Words in parens - 12967 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1565 / 3969
  • Number of attempts: 2
Pairs of numbers - 363 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

  • Best score: 26
  • Best player score: 44
  • Position: #104 / 136
  • Number of attempts: 1
Hole-in-one - 1018 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

  • Best score: 15
  • Best player score: 22
  • Position: #250 / 304
  • Number of attempts: 2
Minimalist Limerick - 520 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 41
  • Position: #147 / 174
  • Number of attempts: 1
A simple change - 468 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 14
  • Position: #115 / 193
  • Number of attempts: 1
SFD-ROC: vimvimvim - 1606 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 14
  • Position: #375 / 446
  • Number of attempts: 1
Let's play some Ivmgolf - 1122 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #294 / 446
  • Number of attempts: 2
replacing each line of a block selection - 3001 entries

replace each line's ../assets/js with /javascripts

  • Best score: 18
  • Best player score: 24
  • Position: #518 / 778
  • Number of attempts: 1
Switch function arguments - 2142 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 14
  • Position: #502 / 665
  • Number of attempts: 4
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 13
  • Position: #349 / 419
  • Number of attempts: 1
switch variable - 5079 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1194 / 1749
  • Number of attempts: 1
The meaning - 575 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #261 / 363
  • 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: 26
  • Position: #258 / 336
  • Number of attempts: 1
Numbering a List - 1935 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Position: #415 / 654
  • Number of attempts: 1
Ruby 1.9 hashes - 1249 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: 14
  • Position: #242 / 407
  • Number of attempts: 2
Shebangs for all - 2018 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

  • Best score: 11
  • Best player score: 19
  • Position: #404 / 519
  • Number of attempts: 2
Reverse and count - 480 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

  • Best score: 18
  • Best player score: 30
  • Position: #122 / 178
  • Number of attempts: 1
Reverse Simple Deletion - 854 entries

You did the simple deletion, now reverse it.

  • Best score: 11
  • Best player score: 12
  • Position: #326 / 460
  • Number of attempts: 1
The Cake is a Lie - 1361 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #226 / 531
  • Number of attempts: 3
Make Fancy Header - 1063 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 24
  • Position: #305 / 346
  • Number of attempts: 1
Reverse characters in a line - 776 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 20
  • Position: #207 / 267
  • Number of attempts: 1
Change the content of a string - 1593 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 27
  • Position: #485 / 594
  • Number of attempts: 1
Sort and add attributes - 1477 entries

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

  • Best score: 33
  • Best player score: 37
  • Position: #466 / 575
  • Number of attempts: 1
Whitespace, empty lines and tabs - 3744 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 28
  • Position: #492 / 804
  • Number of attempts: 1
Simple text editing with Vim - 12996 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 16
  • Position: #2290 / 3739
  • Number of attempts: 4
Kyouma
Twitter:

entered into 64 challenges

contributed 0 challenges