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 - 33616 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: 22
  • Position: #3 / 7420
  • Number of attempts: 2
Wget failed to download redirections - 202 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

  • Best score: 15
  • Best player score: 18
  • Position: #29 / 65
  • Number of attempts: 2
V to the i - 4802 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #833 / 1893
  • Number of attempts: 2
Extract argument from function - 2357 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #275 / 753
  • Number of attempts: 2
That hyphen - 2595 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #389 / 701
  • Number of attempts: 1
Just the middle - 11454 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1591 / 4197
  • Number of attempts: 2
Basic renumbering - 5648 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 17
  • Position: #581 / 1264
  • Number of attempts: 2
JSON string rotation - 64 entries

Right value strings are misplaced. Just rotate them! I'm too kind with you guys and didn't included "strings with \" in it"!

  • Best score: 19
  • Best player score: 24
  • Position: #10 / 22
  • Number of attempts: 1
Vice versa - 7907 entries

Little role switching.

  • Best score: 12
  • Best player score: 14
  • Position: #858 / 2128
  • Number of attempts: 2
Free hyphen! - 169 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

  • Best score: 9
  • Best player score: 11
  • Position: #57 / 89
  • Number of attempts: 1
Restore order to the alphabet - 201 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 26
  • Position: #56 / 72
  • Number of attempts: 3
Mirror Symmetry - 822 entries

Add backslashes.

  • Best score: 7
  • Best player score: 12
  • Position: #129 / 269
  • Number of attempts: 1
Binary and Increment - 56 entries

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

  • Best score: 22
  • Best player score: 25
  • Position: #8 / 20
  • Number of attempts: 2
Cartesian product - 255 entries

{1,2,3,4,5} X {1,2,3,4,5}

  • Best score: 24
  • Best player score: 31
  • Position: #33 / 95
  • Number of attempts: 1
Entries sort - 90 entries

It cames to my mind a weird idea : sorting parts of my .vimrc. Take few minutes to sort out this, it's easy !

  • Best score: 14
  • Best player score: 14
  • Position: #2 / 40
  • Number of attempts: 3
Collect List - 4298 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #3 / 1190
  • Number of attempts: 2
Logging with key - 328 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 28
  • Position: #48 / 88
  • Number of attempts: 2
Space out the alphabet - 1657 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Position: #143 / 444
  • Number of attempts: 3
Sort with uniq OpenEmbedded package names - 45 entries

For each line take 4th dirname of path. For example: "alsa-utils", "gawk-3.1.5", ... But! But if previous result is "files", take 3rd dirname instead. For example: "mktemp", "mklibs" ... If version is present in package name (dash is the separator character), take it. For example: "apt-0.9.9.4" prevails over "apt". And finally, use sort -u to get unique names!

  • Best score: 32
  • Best player score: 46
  • Position: #10 / 15
  • Number of attempts: 2
ASCII box - 347 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 24
  • Position: #44 / 107
  • Number of attempts: 5
50 factorials mod 97 - 58 entries

List 1! to 50!, but give your answer mod 97.

  • Best score: 28
  • Best player score: 38
  • Position: #19 / 20
  • Number of attempts: 3
Mute the second method of this script - 455 entries

prepend a # infront of every line of the second method

  • Best score: 8
  • Best player score: 9
  • Position: #23 / 239
  • 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: 25
  • Position: #7 / 51
  • Number of attempts: 3
Sorting database text output - 223 entries

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

  • Best score: 24
  • Best player score: 26
  • Position: #55 / 83
  • Number of attempts: 2
Refactoring useless Method away - 116 entries

Real-life challenge, convert a bunch of ifs to a switch statement

  • Best score: 47
  • Best player score: 57
  • Position: #17 / 34
  • Number of attempts: 2
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: 27
  • Position: #22 / 54
  • Number of attempts: 2
Condensed Cases - 804 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: 14
  • Position: #122 / 247
  • Number of attempts: 3
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: #12 / 64
  • Number of attempts: 3
Simple Maths - 57 entries

Not much to say, discover by yourself!

  • Best score: 26
  • Best player score: 34
  • Position: #12 / 27
  • Number of attempts: 2
Happy TvvO - 427 entries

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

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

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1450 / 4180
  • Number of attempts: 3
Shift down - 209 entries

Number words are back.

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

so happy to learn vim.because vim is awesome

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

Implementing the methods of a Java Interface

  • Best score: 33
  • Best player score: 35
  • Position: #7 / 27
  • Number of attempts: 6
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: 31
  • Position: #98 / 110
  • Number of attempts: 2
Subtraction - 180 entries

Solve the equations.

  • Best score: 18
  • Best player score: 26
  • Position: #36 / 62
  • Number of attempts: 2
Roman numerals - 81 entries

Use the substitutions on top to convert unary to Roman numerals.

  • Best score: 17
  • Best player score: 29
  • Position: #25 / 29
  • Number of attempts: 1
-a-b-c- - 3213 entries

Put hyphens everywhere.

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

Right AND down.

  • Best score: 13
  • Best player score: 13
  • Position: #8 / 354
  • Number of attempts: 3
Suffix sort - 270 entries

Sort from the end of the line, as if the letters in each line were reversed.

  • Best score: 19
  • Best player score: 24
  • Position: #31 / 67
  • Number of attempts: 3
NBCU Weekly Challenge - Test - 253 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Position: #22 / 116
  • Number of attempts: 3
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: #1 / 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: 14
  • Position: #66 / 158
  • Number of attempts: 4
120 Degrees - 493 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 24
  • Position: #100 / 145
  • Number of attempts: 2
Gray area - 747 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 11
  • Position: #5 / 271
  • Number of attempts: 2
NBCU Weekly Challenge - #0 - 139 entries

One of our favorites lines here at NBCU! p.s. The first version of #0 was deleted due to me copy/pasting a HTML entity. Congrats to the one who figured that out, you are a true ninja warrior!

  • Best score: 30
  • Best player score: 31
  • Position: #24 / 58
  • Number of attempts: 3
Refactor static member invocation - 199 entries

Someone used a static method. Refactor the method into a static import while fixing the assertion.

  • Best score: 28
  • Best player score: 33
  • Position: #35 / 64
  • Number of attempts: 5
Winding path - 122 entries

It's a maze, but the bad paths have been blocked off. Mark the correct path.

  • Best score: 27
  • Best player score: 45
  • Position: #17 / 42
  • Number of attempts: 3
Neither Fizz nor Buzz - 253 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 16
  • Position: #27 / 103
  • Number of attempts: 1
Do you demand a shrubbery? - 1158 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 19
  • Position: #158 / 300
  • Number of attempts: 2
Don't know what this is - 2022 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: 16
  • Position: #423 / 585
  • Number of attempts: 1
Two become one - 713 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

  • Best score: 25
  • Best player score: 28
  • Position: #47 / 208
  • Number of attempts: 2
Piphilology - 144 entries

Piphilology comprises the creation and use of mnemonic techniques to remember a span of digits of the mathematical constant π. http://en.wikipedia.org/wiki/Piphilology

  • Best score: 28
  • Best player score: 38
  • Position: #29 / 52
  • Number of attempts: 6
Mess in revision history - 1184 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 23
  • Position: #130 / 250
  • Number of attempts: 3
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: 15
  • Position: #54 / 104
  • Number of attempts: 5
HTML formatting: vertical alignment for readability - 88 entries

We did this a VimGolf challenge at work and now that we have finished I want to see if you guys can come up with something even better than we could. Our best solution was 44 keystrokes.

  • Best score: 32
  • Best player score: 80
  • Position: #25 / 36
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10663 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1771 / 3683
  • Number of attempts: 2
Change The Perspective - 38 entries

This is a go game recodes file(.sgf file, refer to http://www.red-bean.com/sgf/). It base on such a coordinate system: in vertical direction, is from top(farthest end) to bottom, mark as a,b,c,...,s(19*19 board); in horizontal direction, is from left to right, uses the same notations. For Example, the coordinate notation 'cq', is the position at the bottom-left corner(vertical coordinate first). The record is from one player's perspective. We need to change to another's, but we don't want to change coordinate system, let it keep top to bottom and left to right. so we have to change the coordinates, a <-> s, b <-> r,c <-> q, etc. the Position 'cq', as transformation, it will be 'qd'.

  • Best score: 33
  • Best player score: 47
  • Position: #17 / 23
  • Number of attempts: 3
Words in parens - 12935 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 14
  • Position: #339 / 3963
  • Number of attempts: 3
Carlos López
Twitter:

entered into 59 challenges

contributed 0 challenges