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 - 33791 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: #2634 / 7455
  • Number of attempts: 5
Swap values - 4647 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 13
  • Position: #615 / 1276
  • Number of attempts: 2
One number per line - 18801 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Position: #2198 / 3882
  • Number of attempts: 1
V to the i - 4824 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #573 / 1899
  • Number of attempts: 2
Every other line - 2922 entries

AaAaAaA

  • Best score: 12
  • Best player score: 15
  • Position: #347 / 706
  • Number of attempts: 3
Extract argument from function - 2372 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #360 / 757
  • Number of attempts: 4
Search and Replace 0 - 5007 entries

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

  • Best score: 12
  • Best player score: 13
  • Position: #878 / 1631
  • Number of attempts: 3
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: #51 / 170
  • Number of attempts: 1
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: 9
  • Position: #96 / 328
  • Number of attempts: 3
Just the middle - 11509 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2680 / 4218
  • Number of attempts: 3
Todo list specification - 403 entries

The every item on the todo list must be done today. Modify the list to reflect that.

  • Best score: 37
  • Best player score: 39
  • Position: #147 / 181
  • Number of attempts: 1
For all cases. - 168 entries

In this case... change it! :) Watch the line.

  • Best score: 8
  • Best player score: 8
  • Position: #59 / 108
  • Number of attempts: 1
Basic renumbering - 5685 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #122 / 1270
  • Number of attempts: 1
Adam's challenge - 1008 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: 22
  • Position: #192 / 275
  • Number of attempts: 1
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: 13
  • Position: #115 / 294
  • Number of attempts: 3
Nesting SASS - 278 entries

Move a block inside another block and indent it

  • Best score: 9
  • Best player score: 9
  • Position: #38 / 98
  • Number of attempts: 2
Combines all items - 313 entries

For each line that starts with the same number I want to combine its contents

  • Best score: 9
  • Best player score: 9
  • Position: #66 / 140
  • Number of attempts: 2
Pretty multi-line bash - 235 entries

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

  • Best score: 15
  • Best player score: 24
  • Position: #52 / 77
  • Number of attempts: 1
7th Birthday - 210 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

  • Best score: 19
  • Best player score: 22
  • Position: #35 / 76
  • Number of attempts: 3
Order and join - 985 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 13
  • Position: #190 / 260
  • Number of attempts: 1
Angular naming conventions - 326 entries

In angular, a directive name follows the camelCase convention. When the directive is used in an HTML template, the words are instead separated by a dash. Go from to the other the fastest!

  • Best score: 18
  • Best player score: 20
  • Position: #76 / 119
  • Number of attempts: 1
Collect List - 4312 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #376 / 1193
  • Number of attempts: 4
VimGolfNight - 575 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #259 / 352
  • Number of attempts: 1
Condensed Cases - 807 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: 16
  • Position: #190 / 248
  • Number of attempts: 1
Happy TvvO - 427 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Position: #133 / 206
  • Number of attempts: 2
I forgot quotes - 16061 entries

Oops.

  • Best score: 10
  • Best player score: 18
  • Position: #3301 / 4195
  • Number of attempts: 1
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 14
  • Position: #370 / 1138
  • Number of attempts: 4
Do you demand a shrubbery? - 1164 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 16
  • Position: #93 / 301
  • Number of attempts: 4
Where should I put the Newline? - 883 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 8
  • Position: #392 / 438
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10699 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #2327 / 3695
  • Number of attempts: 3
Letter case trickery - 1644 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: #160 / 520
  • Number of attempts: 3
Words in parens - 12975 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 19
  • Position: #3148 / 3971
  • Number of attempts: 1
Prefixes and suffixes - 637 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 23
  • Position: #64 / 202
  • Number of attempts: 5
The name of the game - 678 entries

End up with the name of the game.

  • Best score: 11
  • Best player score: 12
  • Position: #321 / 363
  • Number of attempts: 2
Switch function arguments - 2162 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #306 / 669
  • Number of attempts: 1
Remove noise from HTTP log - 724 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 15
  • Position: #120 / 275
  • Number of attempts: 3
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 12
  • Position: #941 / 1750
  • Number of attempts: 3
The meaning - 577 entries

Numbers are fun!

  • Best score: 5
  • Best player score: 5
  • Position: #279 / 364
  • Number of attempts: 1
imports alignment (python) - 700 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 24
  • Position: #125 / 198
  • Number of attempts: 1
Numbering a List - 1939 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #32 / 655
  • Number of attempts: 1
Sort and add attributes - 1507 entries

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

  • Best score: 33
  • Best player score: 37
  • Position: #477 / 584
  • Number of attempts: 1
qed
Twitter:

entered into 41 challenges

contributed 0 challenges