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 - 33385 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 / 7364
  • Number of attempts: 2
Wget failed to download redirections - 184 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: #27 / 63
  • Number of attempts: 2
V to the i - 4751 entries

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

  • Best score: 7
  • Best player score: 8
  • Position: #828 / 1879
  • Number of attempts: 2
Extract argument from function - 2314 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #270 / 744
  • Number of attempts: 2
That hyphen - 2556 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Position: #385 / 695
  • Number of attempts: 1
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #1587 / 4164
  • Number of attempts: 2
Basic renumbering - 5587 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 17
  • Position: #576 / 1258
  • Number of attempts: 2
JSON string rotation - 55 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: #9 / 19
  • Number of attempts: 1
Vice versa - 7803 entries

Little role switching.

  • Best score: 12
  • Best player score: 14
  • Position: #852 / 2100
  • Number of attempts: 2
Free hyphen! - 159 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: #55 / 85
  • Number of attempts: 1
Restore order to the alphabet - 188 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 26
  • Position: #53 / 68
  • Number of attempts: 3
Mirror Symmetry - 798 entries

Add backslashes.

  • Best score: 7
  • Best player score: 12
  • Position: #126 / 266
  • Number of attempts: 1
Binary and Increment - 43 entries

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

  • Best score: 22
  • Best player score: 25
  • Position: #7 / 17
  • Number of attempts: 2
Cartesian product - 221 entries

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

  • Best score: 24
  • Best player score: 31
  • Position: #31 / 92
  • Number of attempts: 1
Entries sort - 81 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 / 38
  • Number of attempts: 3
Collect List - 4264 entries

Convert to comma separated list.

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

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 28
  • Position: #46 / 86
  • Number of attempts: 2
Space out the alphabet - 1627 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Position: #141 / 440
  • Number of attempts: 3
Sort with uniq OpenEmbedded package names - 33 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: #8 / 13
  • Number of attempts: 2
ASCII box - 325 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 24
  • Position: #42 / 104
  • Number of attempts: 5
50 factorials mod 97 - 47 entries

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

  • Best score: 28
  • Best player score: 38
  • Position: #17 / 18
  • Number of attempts: 3
Mute the second method of this script - 447 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Position: #22 / 237
  • 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: 25
  • Position: #6 / 49
  • Number of attempts: 3
Sorting database text output - 219 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: #54 / 81
  • Number of attempts: 2
Refactoring useless Method away - 91 entries

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

  • Best score: 47
  • Best player score: 57
  • Position: #15 / 32
  • Number of attempts: 2
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: 27
  • Position: #20 / 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: 14
  • Position: #119 / 242
  • Number of attempts: 3
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: #10 / 62
  • Number of attempts: 3
Simple Maths - 45 entries

Not much to say, discover by yourself!

  • Best score: 26
  • Best player score: 34
  • Position: #10 / 25
  • Number of attempts: 2
Happy TvvO - 407 entries

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

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

Oops.

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

Number words are back.

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

so happy to learn vim.because vim is awesome

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

Implementing the methods of a Java Interface

  • Best score: 33
  • Best player score: 35
  • Position: #5 / 25
  • Number of attempts: 6
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: 31
  • Position: #95 / 107
  • Number of attempts: 2
Subtraction - 178 entries

Solve the equations.

  • Best score: 18
  • Best player score: 26
  • Position: #35 / 61
  • Number of attempts: 2
Roman numerals - 68 entries

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

  • Best score: 17
  • Best player score: 29
  • Position: #23 / 27
  • Number of attempts: 1
-a-b-c- - 3176 entries

Put hyphens everywhere.

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

Right AND down.

  • Best score: 13
  • Best player score: 13
  • Position: #8 / 351
  • Number of attempts: 3
Suffix sort - 254 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: #29 / 65
  • Number of attempts: 3
NBCU Weekly Challenge - Test - 243 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Position: #22 / 114
  • Number of attempts: 3
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: #1 / 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: 14
  • Position: #63 / 154
  • Number of attempts: 4
120 Degrees - 468 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 24
  • Position: #98 / 143
  • Number of attempts: 2
Gray area - 732 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 11
  • Position: #5 / 268
  • Number of attempts: 2
NBCU Weekly Challenge - #0 - 125 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: #22 / 56
  • Number of attempts: 3
Refactor static member invocation - 198 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: #34 / 63
  • Number of attempts: 5
Winding path - 93 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: #15 / 40
  • Number of attempts: 3
Neither Fizz nor Buzz - 226 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 16
  • Position: #24 / 99
  • Number of attempts: 1
Do you demand a shrubbery? - 1120 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 19
  • Position: #155 / 293
  • Number of attempts: 2
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: 16
  • Position: #418 / 578
  • Number of attempts: 1
Two become one - 710 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: #46 / 205
  • Number of attempts: 2
Piphilology - 131 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: 29
  • Best player score: 38
  • Position: #28 / 51
  • Number of attempts: 6
Mess in revision history - 1161 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 23
  • Position: #128 / 247
  • Number of attempts: 3
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: 15
  • Position: #51 / 101
  • Number of attempts: 5
HTML formatting: vertical alignment for readability - 63 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: 33
  • Best player score: 80
  • Position: #23 / 33
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1763 / 3666
  • Number of attempts: 2
Change The Perspective - 36 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: #16 / 22
  • Number of attempts: 3
Words in parens - 12858 entries

We should all ace this, right?

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

entered into 59 challenges

contributed 0 challenges