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

V to the i - 4751 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #132 / 1879
  • Number of attempts: 4
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #366 / 1585
  • Number of attempts: 3
That hyphen - 2556 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 16
  • Position: #617 / 695
  • Number of attempts: 4
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #107 / 4164
  • Number of attempts: 4
Basic renumbering - 5587 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Position: #333 / 1258
  • Number of attempts: 3
Separating firstname & lastname - 120 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 22
  • Position: #14 / 55
  • Number of attempts: 2
Binary and Increment - 43 entries

Some numbers fun: not only increasing numbers but also increasing binary.

  • Best score: 22
  • Best player score: 24
  • Position: #6 / 17
  • Number of attempts: 2
VimGolfNight - 536 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #203 / 343
  • Number of attempts: 1
Winning streak - 124 entries

Make the number on each line equal the consecutive L's or W's.

  • Best score: 21
  • Best player score: 37
  • Position: #36 / 49
  • Number of attempts: 1
Test everything! - 162 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

  • Best score: 22
  • Best player score: 34
  • Position: #37 / 52
  • Number of attempts: 2
Condensed Cases - 788 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: #192 / 242
  • Number of attempts: 3
increment by column in XML - 146 entries

modify an arbitrary "column" in an xml table by incrementing a an arbitrary placeholder string

  • Best score: 19
  • Best player score: 20
  • Position: #13 / 53
  • Number of attempts: 4
Pretty format for variable declarations - 155 entries

Project standards demand the equal signs must be aligned for better readability.

  • Best score: 13
  • Best player score: 14
  • Position: #15 / 62
  • Number of attempts: 7
Happy TvvO - 407 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #9 / 201
  • Number of attempts: 2
C to VimDict - 46 entries

Convert a C data structure to a Vimscript dictionary.

  • Best score: 39
  • Best player score: 42
  • Position: #6 / 13
  • Number of attempts: 6
range(10) digit rotation - 32 entries

This is a data generator challenge or some kind of gift..

  • Best score: 18
  • Best player score: 18
  • Position: #3 / 20
  • Number of attempts: 1
I forgot quotes - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1469 / 4161
  • Number of attempts: 4
Shift down - 193 entries

Number words are back.

  • Best score: 19
  • Best player score: 19
  • Position: #15 / 67
  • Number of attempts: 4
learn vim in short time - 232 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Position: #53 / 158
  • Number of attempts: 3
Replace Parameter with Explicit Methods - 61 entries

Implementing the methods of a Java Interface

  • Best score: 33
  • Best player score: 49
  • Position: #21 / 25
  • Number of attempts: 2
vim1001 - 275 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

  • Best score: 17
  • Best player score: 21
  • Position: #29 / 107
  • Number of attempts: 2
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #514 / 1129
  • Number of attempts: 2
Count both ways - 1001 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #200 / 351
  • Number of attempts: 1
Change name of a variable - 169 entries

Replace the name of the $variable with the fastest move possible. The challenge is having a command that allow you to easily change the variable name even if its indented.

  • Best score: 9
  • Best player score: 9
  • Position: #86 / 132
  • Number of attempts: 1
Lisp Condense - 438 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 13
  • Position: #34 / 154
  • Number of attempts: 6
Do you demand a shrubbery? - 1120 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 15
  • Position: #26 / 293
  • Number of attempts: 5
Don't know what this is - 1978 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: #320 / 578
  • Number of attempts: 2
Where should I put the Newline? - 863 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #130 / 431
  • Number of attempts: 2
Five Pillars - 62 entries

Arrange all words in a table with 5 columns. The minimal space between words in columns is 2 spaces. Columns do have varying width.

  • Best score: 41
  • Best player score: 71
  • Position: #17 / 23
  • Number of attempts: 4
Shuffle puzzle - 317 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

  • Best score: 13
  • Best player score: 16
  • Position: #79 / 101
  • Number of attempts: 1
Going underground.... - 339 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

  • Best score: 22
  • Best player score: 33
  • Position: #94 / 125
  • Number of attempts: 3
Split the words - 356 entries

Add the spaces manually if you must, but if you use Vim's spell checking feature wisely, I think you'll save a LARGE number of strokes.

  • Best score: 18
  • Best player score: 65
  • Position: #106 / 108
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #568 / 3666
  • Number of attempts: 5
attr_aligner - 3444 entries

Two attr keywords. Two separate indentations. Align the colons.

  • Best score: 19
  • Best player score: 32
  • Position: #481 / 692
  • Number of attempts: 4
Letter case trickery - 1594 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: #121 / 511
  • Number of attempts: 3
quotes inside quotes - 3125 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: #442 / 1072
  • Number of attempts: 2
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1415 / 3946
  • Number of attempts: 7
Hole-in-one - 1012 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: 21
  • Position: #216 / 302
  • Number of attempts: 2
Minimalist Limerick - 516 entries

Reproduce this lovely poem.

  • Best score: 31
  • Best player score: 32
  • Position: #41 / 171
  • Number of attempts: 5
fib.c cleanup - 66 entries

cleanup the file

  • Best score: 15
  • Best player score: 16
  • Position: #40 / 54
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1581 entries

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

  • Best score: 8
  • Best player score: 8
  • Position: #65 / 439
  • Number of attempts: 5
Saving the hashes(#) - 1992 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: 27
  • Position: #254 / 473
  • Number of attempts: 3
Let's play some Ivmgolf - 1091 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #75 / 441
  • Number of attempts: 3
Vertical Limit - 2437 entries

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

  • Best score: 21
  • Best player score: 26
  • Position: #457 / 736
  • Number of attempts: 2
Exchanging Quotes - 821 entries

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

  • Best score: 30
  • Best player score: 34
  • Position: #84 / 225
  • Number of attempts: 3
replacing each line of a block selection - 2947 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #169 / 768
  • Number of attempts: 7
Switch function arguments - 2082 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 11
  • Position: #108 / 652
  • Number of attempts: 3
Append semicolon after expressions - 1005 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #219 / 403
  • Number of attempts: 2
switch variable - 5036 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1154 / 1736
  • Number of attempts: 1
Make it more readable - 1952 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #390 / 640
  • Number of attempts: 1
A Simple One - 1001 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: #399 / 643
  • Number of attempts: 1
The Cake is a Lie - 1286 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 9
  • Position: #198 / 512
  • Number of attempts: 2
Change the content of a string - 1476 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #149 / 558
  • Number of attempts: 4
Whitespace, empty lines and tabs - 3339 entries

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

  • Best score: 16
  • Best player score: 26
  • Position: #397 / 736
  • Number of attempts: 3
Simple text editing with Vim - 12284 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1353 / 3581
  • Number of attempts: 4
Jake Eskel
Twitter:

A proud conservative, high-school homeschooler, and a multi-lingual programmer.

entered into 55 challenges

contributed 0 challenges