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 - 4743 entries

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

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

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

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

"vim vi improved"

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

Delete the instructions at the top and bottom.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Position: #332 / 1255
  • Number of attempts: 3
Separating firstname & lastname - 117 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 22
  • Position: #13 / 54
  • 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 - 531 entries

Based on "The name of the game".

  • Best score: 12
  • Best player score: 12
  • Position: #203 / 342
  • 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! - 159 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: #36 / 51
  • Number of attempts: 2
Condensed Cases - 777 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: #190 / 240
  • 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 - 154 entries

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

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

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

  • Best score: 12
  • Best player score: 12
  • Position: #9 / 199
  • 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 - 15918 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1467 / 4158
  • 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 - 228 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • Position: #53 / 156
  • 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- - 3169 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #513 / 1126
  • Number of attempts: 2
Count both ways - 995 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #198 / 349
  • 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? - 859 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #130 / 430
  • Number of attempts: 2
Five Pillars - 60 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: #16 / 22
  • 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.... - 330 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: #93 / 124
  • 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 ! - 10615 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 11
  • Position: #568 / 3662
  • 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 - 3124 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: #441 / 1071
  • Number of attempts: 2
Words in parens - 12848 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1415 / 3943
  • 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 - 1569 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 / 437
  • 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 - 1084 entries

Oops, I spelled that wrong.

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

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

  • Best score: 21
  • Best player score: 26
  • Position: #455 / 733
  • Number of attempts: 2
Exchanging Quotes - 809 entries

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

  • Best score: 30
  • Best player score: 34
  • Position: #83 / 222
  • Number of attempts: 3
replacing each line of a block selection - 2923 entries

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

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

How to switch two arguments of a function.

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

Some lines need the semicolon, some don't.

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

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1153 / 1733
  • Number of attempts: 1
Make it more readable - 1950 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #390 / 639
  • Number of attempts: 1
A Simple One - 996 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 / 641
  • Number of attempts: 1
The Cake is a Lie - 1284 entries

Correct the capitalization of each word

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

This docstring is a complete lie. Fix it.

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

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

  • Best score: 16
  • Best player score: 26
  • Position: #390 / 726
  • Number of attempts: 3
Simple text editing with Vim - 12205 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1352 / 3561
  • 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