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

HTML formatting: vertical alignment for readability - 59 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
  • Number of attempts: 1
Refactoring useless Method away - 74 entries

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

  • Best score: 47
  • Best player score: 57
  • Number of attempts: 2
Change The Perspective - 31 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
  • Number of attempts: 3
Sort with uniq OpenEmbedded package names - 26 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
  • Number of attempts: 2
Winding path - 91 entries

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

  • Best score: 27
  • Best player score: 45
  • Number of attempts: 3
50 factorials mod 97 - 24 entries

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

  • Best score: 28
  • Best player score: 38
  • Number of attempts: 3
Piphilology - 114 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
  • Number of attempts: 6
Refactor static member invocation - 163 entries

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

  • Best score: 28
  • Best player score: 33
  • Number of attempts: 5
Cartesian product - 201 entries

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

  • Best score: 24
  • Best player score: 31
  • Number of attempts: 1
vim1001 - 221 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

  • Best score: 17
  • Best player score: 31
  • Number of attempts: 2
NBCU Weekly Challenge - #0 - 118 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
  • Number of attempts: 3
Pretty format for variable declarations - 128 entries

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

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 3
I forgot quotes - 10039 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Number of attempts: 3
Condensed Cases - 656 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
  • Number of attempts: 3
Words in parens - 10287 entries

We should all ace this, right?

  • Best score: 14
  • Best player score: 14
  • Number of attempts: 3
Vice versa - 5300 entries

Little role switching.

  • Best score: 2
  • Best player score: 14
  • Number of attempts: 2
Shift down - 162 entries

Number words are back.

  • Best score: 19
  • Best player score: 29
  • Number of attempts: 2
Lisp Condense - 356 entries

Reduce 4 cons selection operations down to one function call.

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 4
Change name of a variable - 143 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
  • Number of attempts: 1
Do you demand a shrubbery? - 963 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 19
  • Number of attempts: 2
Count both ways - 846 entries

Right AND down.

  • Best score: 13
  • Best player score: 13
  • Number of attempts: 3
Just the middle - 8429 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
Neither Fizz nor Buzz - 187 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 16
  • Number of attempts: 1
Space out the alphabet - 1251 entries

Put 3 spaces between adjacent letters.

  • Best score: 15
  • Best player score: 17
  • Number of attempts: 3
A HAPPY NEW YEAR 2014 ! - 9017 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Number of attempts: 2
Collect List - 3124 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
learn vim in short time - 175 entries

so happy to learn vim.because vim is awesome

  • Best score: 8
  • Best player score: 8
  • 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
  • Number of attempts: 6
Sorting database text output - 183 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
  • Number of attempts: 2
Mute the second method of this script - 393 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 9
  • Number of attempts: 1
Shuffle puzzle - 284 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
  • Number of attempts: 5
V to the i - 3499 entries

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

  • Best score: 7
  • Best player score: 8
  • Number of attempts: 2
Free hyphen! - 109 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
  • Number of attempts: 1
Simple Maths - 27 entries

Not much to say, discover by yourself!

  • Best score: 26
  • Best player score: 34
  • Number of attempts: 2
Extract argument from function - 1791 entries

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

  • Best score: 13
  • Best player score: 14
  • Number of attempts: 2
Don't know what this is - 1571 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
  • Number of attempts: 1
Restore order to the alphabet - 149 entries

The numbers are OK. The letters are wonky.

  • Best score: 12
  • Best player score: 26
  • Number of attempts: 3
Logging with key - 263 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 28
  • Number of attempts: 2
That hyphen - 1841 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 12
  • Number of attempts: 1
Gray area - 602 entries

It's a golf metaphor or something.

  • Best score: 11
  • Best player score: 11
  • Number of attempts: 2
Basic renumbering - 4076 entries

Renumbering Basic.

  • Best score: 2
  • Best player score: 17
  • Number of attempts: 2
-a-b-c- - 2325 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Number of attempts: 2
NBCU Weekly Challenge - Test - 214 entries

Just testing.

  • Best score: 18
  • Best player score: 18
  • Number of attempts: 3
Entries sort - 69 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
  • Number of attempts: 3
Wget failed to download redirections - 153 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
  • Number of attempts: 2
Mess in revision history - 919 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 23
  • Number of attempts: 3
120 Degrees - 337 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 24
  • Number of attempts: 2
Happy TvvO - 339 entries

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

  • Best score: 12
  • Best player score: 12
  • Number of attempts: 2
Winning streak - 105 entries

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

  • Best score: 21
  • Best player score: 25
  • Number of attempts: 3
Subtraction - 147 entries

Solve the equations.

  • Best score: 18
  • Best player score: 26
  • Number of attempts: 2
Suffix sort - 163 entries

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

  • Best score: 19
  • Best player score: 24
  • Number of attempts: 3
Test everything! - 111 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
  • Number of attempts: 2
JSON string rotation - 38 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
  • Number of attempts: 1
Binary and Increment - 36 entries

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

  • Best score: 23
  • Best player score: 25
  • Number of attempts: 2
ASCII box - 286 entries

Don't forget to fix typos!

  • Best score: 23
  • Best player score: 24
  • Number of attempts: 5
Simple, Practical, and Common - 20860 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: 5
  • Best player score: 22
  • Number of attempts: 2
Two become one - 631 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
  • Number of attempts: 2
Mirror Symmetry - 676 entries

Add backslashes.

  • Best score: 7
  • Best player score: 12
  • Number of attempts: 1
Roman numerals - 57 entries

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

  • Best score: 17
  • Best player score: 29
  • Number of attempts: 1
Carlos López
Twitter:

entered into 59 challenges

contributed 0 challenges