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 - 33866 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: #1416 / 7474
  • Number of attempts: 14
vim = 22 / 7 - 475 entries

pi square vim

  • Best score: 20
  • Best player score: 40
  • Position: #131 / 135
  • Number of attempts: 1
Swap values inside brackets - 2523 entries

Easy challenge.

  • Best score: 13
  • Best player score: 15
  • Position: #127 / 587
  • Number of attempts: 10
V to the i - 4830 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #580 / 1903
  • Number of attempts: 5
Every other line - 2925 entries

AaAaAaA

  • Best score: 12
  • Best player score: 20
  • Position: #617 / 707
  • Number of attempts: 2
Copy three lines - 2882 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #101 / 642
  • Number of attempts: 6
Extract argument from function - 2376 entries

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

  • Best score: 13
  • Best player score: 16
  • Position: #543 / 759
  • Number of attempts: 5
Number Sort - 319 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 9
  • Position: #59 / 170
  • Number of attempts: 1
That hyphen - 2602 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 9
  • Position: #184 / 704
  • Number of attempts: 5
comment and uncomment code inline - 1151 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: 12
  • Position: #262 / 328
  • Number of attempts: 4
Just the middle - 11541 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1130 / 4230
  • Number of attempts: 7
Team names - 1848 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 18
  • Position: #373 / 592
  • Number of attempts: 9
Remember VimGolf Rules ! - 268 entries

Rules, ... and don't forget !

  • Best score: 7
  • Best player score: 7
  • Position: #33 / 145
  • Number of attempts: 1
Basic renumbering - 5699 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #129 / 1273
  • Number of attempts: 11
Adam's challenge - 1009 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: #66 / 276
  • Number of attempts: 10
Fiddle percentages into real numbers - 873 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: 27
  • Position: #283 / 294
  • Number of attempts: 1
Nesting SASS - 287 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 15
  • Position: #57 / 99
  • Number of attempts: 5
Vice versa - 7974 entries

Little role switching.

  • Best score: 12
  • Best player score: 20
  • Position: #1881 / 2146
  • Number of attempts: 2
Order and join - 992 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 10
  • Position: #53 / 261
  • Number of attempts: 11
comments galore - 1073 entries

Basic comment reformatting

  • Best score: 10
  • Best player score: 10
  • Position: #252 / 429
  • Number of attempts: 3
Align commas - 1097 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: 33
  • Position: #243 / 247
  • Number of attempts: 1
convert yml into java pojo field - 867 entries

How fast vim can create fields for java pojo i.e class declaration referring to a (simple) yml file

  • Best score: 29
  • Best player score: 32
  • Position: #152 / 230
  • Number of attempts: 4
Change your calendar - 397 entries

Happy New Year!

  • Best score: 18
  • Best player score: 105
  • Position: #88 / 88
  • Number of attempts: 1
Collect List - 4317 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 14
  • Position: #662 / 1194
  • Number of attempts: 5
I forgot quotes - 16093 entries

Oops.

  • Best score: 10
  • Best player score: 57
  • Position: #4195 / 4202
  • Number of attempts: 1
-a-b-c- - 3225 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #371 / 1140
  • Number of attempts: 5
Where should I put the Newline? - 883 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #201 / 438
  • Number of attempts: 3
Vim tetris - 371 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 39
  • Position: #91 / 104
  • Number of attempts: 1
Carriage return - 45 entries

I have some raw data from terminal output which uses carriege return for formatting. Carriage return sets the pointer to the first character on the line, and subsequent characters will overwrite what was there before. The challange is to simulate the terminal behaviour in vim. I'm kind of unsure if I should have skipped lines 9 and 15, since there might be some interesting solutions which are not that generic. Happy Golfing!

  • Best score: 22
  • Best player score: 45
  • Position: #21 / 22
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10713 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 13
  • Position: #2615 / 3700
  • Number of attempts: 2
Ninjas Leaderboard - 102 entries

The two lines in "Start file" has an obfuscated email address. Second line give an index (from 1 to 30) to the chars list of the first line, for example, the first char of email (n) is in position 25, second char (i) is in position 19 and s.o.

  • Best score: 25
  • Best player score: 34
  • Position: #17 / 42
  • Number of attempts: 4
quotes inside quotes - 3185 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: 15
  • Position: #483 / 1086
  • Number of attempts: 5
Top X - 212 entries

The End File is the Top 10 Vimgolf Leaderboard at June 29, 2013. This is a second version, with a great contribution of @udioica. X is ten in Roman,a numeric system in ancient Rome

  • Best score: 18
  • Best player score: 18
  • Position: #5 / 71
  • Number of attempts: 12
Words in parens - 12992 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 25
  • Position: #3789 / 3977
  • Number of attempts: 2
NATO phonetic alphabet - 538 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 21
  • Position: #104 / 197
  • Number of attempts: 4
Saving the hashes(#) - 2067 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: 53
  • Position: #471 / 480
  • Number of attempts: 2
Vertical Limit - 2596 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #247 / 767
  • Number of attempts: 6
Switch function arguments - 2182 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #156 / 674
  • Number of attempts: 4
switch variable - 5094 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1222 / 1754
  • Number of attempts: 3
Complete the hex array data (Part II) - 166 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

  • Best score: 20
  • Best player score: 26
  • Position: #51 / 69
  • Number of attempts: 2
Insert a Markdown link - 465 entries

Put a link in a markdown document, using the after-the-paragraph format.

  • Best score: 22
  • Best player score: 25
  • Position: #92 / 154
  • Number of attempts: 2
The holy-grail may help - 389 entries

Can you find it in less than 20 strokes, Arthur?

  • Best score: 16
  • Best player score: 16
  • Position: #145 / 215
  • Number of attempts: 9
Round Round - 321 entries

Round Round

  • Best score: 19
  • Best player score: 19
  • Position: #6 / 88
  • Number of attempts: 22
The Cake is a Lie - 1386 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 10
  • Position: #387 / 537
  • Number of attempts: 1
Context Insensitive completion 1 - 512 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 18
  • Position: #137 / 248
  • Number of attempts: 3
Reformat a C golf submission - 614 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

  • Best score: 22
  • Best player score: 32
  • Position: #116 / 210
  • Number of attempts: 3
Sort and add attributes - 1539 entries

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

  • Best score: 33
  • Best player score: 33
  • Position: #209 / 594
  • Number of attempts: 2
Simple text editing with Vim - 13262 entries

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

  • Best score: 13
  • Best player score: 13
  • Position: #542 / 3810
  • Number of attempts: 3
Hugo
Twitter:

entered into 48 challenges

contributed 0 challenges