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

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

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

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

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

"vim vi improved"

  • Best score: 9
  • Best player score: 16
  • Position: #620 / 698
  • Number of attempts: 4
Just the middle - 11380 entries

Delete the instructions at the top and bottom.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Position: #335 / 1260
  • Number of attempts: 3
Separating firstname & lastname - 121 entries

Seperate named with equal tabs.

  • Best score: 19
  • Best player score: 22
  • Position: #15 / 56
  • Number of attempts: 2
Binary and Increment - 48 entries

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

  • Best score: 22
  • Best player score: 24
  • Position: #7 / 18
  • Number of attempts: 2
VimGolfNight - 538 entries

Based on "The name of the game".

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

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

  • Best score: 21
  • Best player score: 37
  • Position: #37 / 50
  • Number of attempts: 1
Test everything! - 163 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: #38 / 53
  • Number of attempts: 2
Condensed Cases - 794 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: #194 / 244
  • Number of attempts: 3
increment by column in XML - 147 entries

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

  • Best score: 19
  • Best player score: 20
  • Position: #14 / 54
  • Number of attempts: 4
Pretty format for variable declarations - 156 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #16 / 63
  • Number of attempts: 7
Happy TvvO - 417 entries

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

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

Convert a C data structure to a Vimscript dictionary.

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

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

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

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1471 / 4166
  • Number of attempts: 4
Shift down - 194 entries

Number words are back.

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

so happy to learn vim.because vim is awesome

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

Implementing the methods of a Java Interface

  • Best score: 33
  • Best player score: 49
  • Position: #22 / 26
  • Number of attempts: 2
vim1001 - 284 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: #30 / 108
  • Number of attempts: 2
-a-b-c- - 3183 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #516 / 1132
  • Number of attempts: 2
Count both ways - 1006 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #201 / 352
  • Number of attempts: 1
Change name of a variable - 173 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 / 136
  • Number of attempts: 1
Lisp Condense - 449 entries

Reduce 4 cons selection operations down to one function call.

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

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 15
  • Position: #26 / 298
  • Number of attempts: 5
Don't know what this is - 1996 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: #323 / 581
  • Number of attempts: 2
Where should I put the Newline? - 874 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #130 / 436
  • Number of attempts: 2
Five Pillars - 63 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: #18 / 24
  • Number of attempts: 4
Shuffle puzzle - 331 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: #81 / 103
  • Number of attempts: 1
Going underground.... - 349 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: #96 / 127
  • Number of attempts: 3
Split the words - 357 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: #107 / 109
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10652 entries

A HAPPY NEW YEAR 2014 !

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

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

  • Best score: 19
  • Best player score: 32
  • Position: #482 / 695
  • Number of attempts: 4
Letter case trickery - 1598 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: #122 / 514
  • Number of attempts: 3
quotes inside quotes - 3128 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: #443 / 1073
  • Number of attempts: 2
Words in parens - 12868 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1417 / 3950
  • Number of attempts: 7
Hole-in-one - 1017 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: #217 / 303
  • Number of attempts: 2
Minimalist Limerick - 519 entries

Reproduce this lovely poem.

  • Best score: 30
  • Best player score: 32
  • Position: #42 / 173
  • Number of attempts: 5
fib.c cleanup - 67 entries

cleanup the file

  • Best score: 15
  • Best player score: 16
  • Position: #40 / 55
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1594 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 / 443
  • Number of attempts: 5
Saving the hashes(#) - 2008 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: #255 / 476
  • Number of attempts: 3
Let's play some Ivmgolf - 1096 entries

Oops, I spelled that wrong.

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

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

  • Best score: 21
  • Best player score: 26
  • Position: #463 / 748
  • Number of attempts: 2
Exchanging Quotes - 824 entries

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

  • Best score: 30
  • Best player score: 34
  • Position: #85 / 227
  • Number of attempts: 3
replacing each line of a block selection - 2966 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #172 / 772
  • Number of attempts: 7
Switch function arguments - 2085 entries

How to switch two arguments of a function.

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

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #223 / 410
  • Number of attempts: 2
switch variable - 5045 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 13
  • Position: #1157 / 1742
  • Number of attempts: 1
Make it more readable - 1955 entries

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #391 / 643
  • Number of attempts: 1
A Simple One - 1009 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 / 648
  • Number of attempts: 1
The Cake is a Lie - 1301 entries

Correct the capitalization of each word

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

This docstring is a complete lie. Fix it.

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

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

  • Best score: 16
  • Best player score: 26
  • Position: #410 / 758
  • Number of attempts: 3
Simple text editing with Vim - 12491 entries

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

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