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

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

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

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

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

"vim vi improved"

  • Best score: 9
  • Best player score: 16
  • Position: #622 / 701
  • Number of attempts: 4
Just the middle - 11418 entries

Delete the instructions at the top and bottom.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Position: #337 / 1262
  • Number of attempts: 3
Separating firstname & lastname - 138 entries

Seperate named with equal tabs.

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

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

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

Based on "The name of the game".

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

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

  • Best score: 21
  • Best player score: 37
  • Position: #38 / 51
  • Number of attempts: 1
Test everything! - 186 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: #39 / 54
  • Number of attempts: 2
Condensed Cases - 800 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 / 245
  • Number of attempts: 3
increment by column in XML - 152 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 / 55
  • Number of attempts: 4
Pretty format for variable declarations - 170 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #17 / 64
  • Number of attempts: 7
Happy TvvO - 426 entries

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

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

Convert a C data structure to a Vimscript dictionary.

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

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

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

Oops.

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

Number words are back.

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

so happy to learn vim.because vim is awesome

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

Implementing the methods of a Java Interface

  • Best score: 33
  • Best player score: 49
  • Position: #23 / 27
  • Number of attempts: 2
vim1001 - 307 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: #31 / 110
  • Number of attempts: 2
-a-b-c- - 3213 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #518 / 1137
  • Number of attempts: 2
Count both ways - 1022 entries

Right AND down.

  • Best score: 13
  • Best player score: 16
  • Position: #202 / 354
  • Number of attempts: 1
Change name of a variable - 179 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 / 137
  • Number of attempts: 1
Lisp Condense - 460 entries

Reduce 4 cons selection operations down to one function call.

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

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 15
  • Position: #26 / 300
  • Number of attempts: 5
Don't know what this is - 2014 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: #324 / 582
  • Number of attempts: 2
Where should I put the Newline? - 881 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #130 / 437
  • 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 - 346 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: #82 / 104
  • Number of attempts: 1
Going underground.... - 350 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 ! - 10654 entries

A HAPPY NEW YEAR 2014 !

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

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

  • Best score: 19
  • Best player score: 32
  • Position: #483 / 696
  • Number of attempts: 4
Letter case trickery - 1619 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: #123 / 515
  • Number of attempts: 3
quotes inside quotes - 3154 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: #444 / 1075
  • Number of attempts: 2
Words in parens - 12918 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1422 / 3957
  • 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 - 520 entries

Reproduce this lovely poem.

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

cleanup the file

  • Best score: 15
  • Best player score: 16
  • Position: #41 / 55
  • Number of attempts: 2
SFD-ROC: vimvimvim - 1606 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 / 446
  • Number of attempts: 5
Saving the hashes(#) - 2048 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: #256 / 478
  • Number of attempts: 3
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

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

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

  • Best score: 21
  • Best player score: 26
  • Position: #465 / 751
  • Number of attempts: 2
Exchanging Quotes - 851 entries

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

  • Best score: 30
  • Best player score: 34
  • Position: #86 / 228
  • Number of attempts: 3
replacing each line of a block selection - 2987 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #174 / 774
  • Number of attempts: 7
Switch function arguments - 2117 entries

How to switch two arguments of a function.

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

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #225 / 413
  • Number of attempts: 2
switch variable - 5061 entries

how fast can you switch two variable ?

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

Insert blank lines to make it more organized and readable

  • Best score: 13
  • Best player score: 16
  • Position: #392 / 645
  • Number of attempts: 1
A Simple One - 1039 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 / 658
  • Number of attempts: 1
The Cake is a Lie - 1330 entries

Correct the capitalization of each word

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

This docstring is a complete lie. Fix it.

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

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

  • Best score: 16
  • Best player score: 26
  • Position: #417 / 773
  • Number of attempts: 3
Simple text editing with Vim - 12632 entries

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

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