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 - 33621 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: #2520 / 7422
  • Number of attempts: 5
Swap values - 4616 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 14
  • Position: #682 / 1268
  • Number of attempts: 6
One number per line - 18732 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1092 / 3865
  • Number of attempts: 7
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 9
  • Position: #1662 / 1893
  • Number of attempts: 1
Split line with dots - 2144 entries

This line is too long, split it.

  • Best score: 15
  • Best player score: 16
  • Position: #196 / 634
  • Number of attempts: 8
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: 15
  • Position: #207 / 640
  • Number of attempts: 6
Extract argument from function - 2357 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #166 / 753
  • Number of attempts: 4
Search and Replace 0 - 4989 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #847 / 1624
  • Number of attempts: 3
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #461 / 701
  • Number of attempts: 4
Just the middle - 11457 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2229 / 4198
  • Number of attempts: 5
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 18
  • Position: #670 / 1264
  • Number of attempts: 2
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: 12
  • Position: #79 / 174
  • Number of attempts: 3
Wrap text in quotes - 368 entries

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

  • Best score: 16
  • Best player score: 17
  • Position: #63 / 122
  • 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: 12
  • Position: #80 / 81
  • Number of attempts: 1
Vice versa - 7907 entries

Little role switching.

  • Best score: 12
  • Best player score: 13
  • Position: #739 / 2128
  • Number of attempts: 6
Pretty multi-line bash - 235 entries

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

  • Best score: 15
  • Best player score: 31
  • Position: #67 / 77
  • Number of attempts: 1
C Reformatting - 690 entries

You may use Visual mode... or not. #uppercase

  • Best score: 30
  • Best player score: 35
  • Position: #58 / 163
  • Number of attempts: 4
Paragraph sort - 450 entries

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

  • Best score: 14
  • Best player score: 19
  • Position: #96 / 125
  • Number of attempts: 3
Sorting a glossary - 131 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
  • Position: #46 / 81
  • Number of attempts: 1
comments galore - 1045 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #189 / 424
  • Number of attempts: 4
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: #59 / 82
  • Number of attempts: 2
Scrambled numbers - 807 entries

Four is NOT 1. One is 1.

  • Best score: 18
  • Best player score: 23
  • Position: #95 / 184
  • Number of attempts: 8
Alsa configuration - 513 entries

I'm tweaking my ~/.asoundrc file!

  • Best score: 22
  • Best player score: 27
  • Position: #74 / 128
  • Number of attempts: 5
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: 20
  • Position: #217 / 246
  • Number of attempts: 1
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 12
  • Position: #161 / 269
  • Number of attempts: 2
From A to B - 591 entries

Mirror and change this text block

  • Best score: 16
  • Best player score: 16
  • Position: #23 / 159
  • Number of attempts: 6
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #230 / 1190
  • Number of attempts: 5
Logging with key - 328 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 36
  • Position: #71 / 88
  • Number of attempts: 1
Space out the alphabet - 1657 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Position: #184 / 444
  • Number of attempts: 6
Fix the XML - 1039 entries

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

  • Best score: 18
  • Best player score: 23
  • Position: #107 / 290
  • Number of attempts: 3
Shuffled numbers - 246 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

  • Best score: 15
  • Best player score: 16
  • Position: #67 / 96
  • 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: 9
  • Position: #114 / 239
  • Number of attempts: 4
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: 15
  • Position: #171 / 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: #115 / 206
  • Number of attempts: 3
I forgot quotes - 15989 entries

Oops.

  • Best score: 10
  • Best player score: 12
  • Position: #1290 / 4181
  • Number of attempts: 7
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #633 / 1137
  • Number of attempts: 2
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #252 / 354
  • Number of attempts: 4
Don't know what this is - 2022 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
  • Position: #354 / 585
  • Number of attempts: 4
A HAPPY NEW YEAR 2014 ! - 10669 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #993 / 3684
  • Number of attempts: 3
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: 12
  • Position: #350 / 518
  • Number of attempts: 4
Words in parens - 12939 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1545 / 3964
  • Number of attempts: 2
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #291 / 445
  • Number of attempts: 1
Vertical Limit - 2538 entries

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

  • Best score: 21
  • Best player score: 25
  • Position: #371 / 754
  • Number of attempts: 2
replacing each line of a block selection - 2999 entries

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

  • Best score: 18
  • Best player score: 30
  • Position: #660 / 777
  • Number of attempts: 1
Switch function arguments - 2139 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 13
  • Position: #416 / 663
  • Number of attempts: 1
Append semicolon after expressions - 1056 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 11
  • Position: #97 / 419
  • Number of attempts: 4
switch variable - 5071 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #426 / 1748
  • Number of attempts: 3
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: 24
  • Position: #233 / 336
  • Number of attempts: 1
Numbering a List - 1931 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 21
  • Position: #412 / 652
  • Number of attempts: 2
Shebangs for all - 1999 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: 13
  • Position: #204 / 516
  • Number of attempts: 4
The Cake is a Lie - 1346 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #222 / 527
  • Number of attempts: 2
Make Fancy Header - 1052 entries

Make the header text stand out with surrounding asterisks

  • Best score: 15
  • Best player score: 16
  • Position: #105 / 344
  • Number of attempts: 1
Change the content of a string - 1580 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 26
  • Position: #420 / 588
  • Number of attempts: 2
Sort and add attributes - 1452 entries

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

  • Best score: 33
  • Best player score: 34
  • Position: #359 / 564
  • Number of attempts: 3
Jeremiah Goyette
Twitter:

Software Engineer at @epicomcorp. PhD Music Theory, Eastman School of Music

entered into 54 challenges

contributed 0 challenges