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

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

  • Best score: 7
  • Best player score: 11
  • Position: #1777 / 1879
  • Number of attempts: 1
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: 17
  • Position: #546 / 744
  • Number of attempts: 1
Search and Replace 0 - 4790 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #101 / 1585
  • Number of attempts: 4
That hyphen - 2556 entries

"vim vi improved"

  • Best score: 9
  • Best player score: 22
  • Position: #678 / 695
  • Number of attempts: 1
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 63 entries

I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!

  • Best score: 18
  • Best player score: 18
  • Position: #18 / 37
  • Number of attempts: 2
7th Birthday - 186 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

  • Best score: 19
  • Best player score: 30
  • Position: #69 / 73
  • Number of attempts: 3
O Christmas Tree - 108 entries

Design a macro that makes trees grow (or ASCII triangles, if that's too hard).

  • Best score: 22
  • Best player score: 33
  • Position: #39 / 42
  • Number of attempts: 1
VimGolfNight - 536 entries

Based on "The name of the game".

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

Oops.

  • Best score: 10
  • Best player score: 17
  • Position: #2729 / 4161
  • Number of attempts: 3
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: 30
  • Position: #94 / 107
  • Number of attempts: 2
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 17
  • Position: #872 / 1129
  • Number of attempts: 1
NBCU Weekly Challenge - Test - 243 entries

Just testing.

  • Best score: 18
  • Best player score: 21
  • Position: #99 / 114
  • Number of attempts: 2
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: #14 / 132
  • Number of attempts: 1
120 Degrees - 468 entries

Rotate that triangle.

  • Best score: 14
  • Best player score: 29
  • Position: #127 / 143
  • Number of attempts: 2
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: 37
  • Position: #39 / 63
  • Number of attempts: 2
Neither Fizz nor Buzz - 226 entries

Not your regular increment macro! The gaps are tricky.

  • Best score: 13
  • Best player score: 20
  • Position: #39 / 99
  • Number of attempts: 3
Do you demand a shrubbery? - 1120 entries

Use :redir and crush the emacsgolfers.

  • Best score: 15
  • Best player score: 35
  • Position: #291 / 293
  • Number of attempts: 1
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: 14
  • Position: #278 / 578
  • Number of attempts: 4
Where should I put the Newline? - 863 entries

Help me put the newline.

  • Best score: 7
  • Best player score: 7
  • Position: #28 / 431
  • Number of attempts: 3
Vim tetris - 352 entries

Vim can play tetris too!

  • Best score: 21
  • Best player score: 54
  • Position: #96 / 101
  • Number of attempts: 1
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: #29 / 51
  • Number of attempts: 1
Mess in revision history - 1161 entries

Help Joe clean up what Steve has cobbled.

  • Best score: 17
  • Best player score: 27
  • Position: #153 / 247
  • Number of attempts: 1
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: 16
  • Position: #70 / 101
  • Number of attempts: 2
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: 164
  • Position: #32 / 33
  • Number of attempts: 1
Going underground.... - 339 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: 58
  • Position: #121 / 125
  • Number of attempts: 2
A HAPPY NEW YEAR 2014 ! - 10624 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 12
  • Position: #1766 / 3666
  • Number of attempts: 7
attr_aligner - 3444 entries

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

  • Best score: 19
  • Best player score: 37
  • Position: #598 / 692
  • Number of attempts: 1
Letter case trickery - 1594 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: 14
  • Position: #425 / 511
  • Number of attempts: 3
Words in parens - 12858 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1369 / 3946
  • Number of attempts: 2
switch variable - 5036 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 11
  • Position: #16 / 1736
  • Number of attempts: 2
Replacing some words - 419 entries

How fast could it be?

  • Best score: 17
  • Best player score: 25
  • Position: #91 / 148
  • Number of attempts: 1
Sort the cardinal numbers - 293 entries

Maybe a simple challenge.

  • Best score: 12
  • Best player score: 14
  • Position: #72 / 146
  • Number of attempts: 1
remove dupes from array - 1336 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

  • Best score: 17
  • Best player score: 26
  • Position: #247 / 331
  • Number of attempts: 2
imports alignment (python) - 661 entries

Align as one import per line.

  • Best score: 17
  • Best player score: 24
  • Position: #116 / 194
  • Number of attempts: 2
Generate Fibonacci Numbers - 262 entries

Use your super vim powers to generate Fibonacci Numbers.

  • Best score: 19
  • Best player score: 26
  • Position: #81 / 97
  • Number of attempts: 1
Rotating Philosophers Problem - 390 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

  • Best score: 29
  • Best player score: 32
  • Position: #106 / 163
  • Number of attempts: 5
HTML to Haml - 842 entries

Help convert this HTML page to Haml.

  • Best score: 23
  • Best player score: 62
  • Position: #190 / 202
  • Number of attempts: 2
expand a list comprehension (python) - 301 entries

Please show your way to convert a list comprehension in python to an ordinary for-loop expression!

  • Best score: 42
  • Best player score: 69
  • Position: #93 / 106
  • Number of attempts: 2
Numbering a List - 1859 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 33
  • Position: #600 / 639
  • Number of attempts: 1
Java Array2List - 225 entries

Convert an java array initializer into a list.

  • Best score: 67
  • Best player score: 118
  • Position: #60 / 83
  • Number of attempts: 3
Assignment Alignment - 832 entries

line up the operators. Use spaces, not tabs.

  • Best score: 18
  • Best player score: 38
  • Position: #197 / 215
  • Number of attempts: 2
The Cake is a Lie - 1286 entries

Correct the capitalization of each word

  • Best score: 9
  • Best player score: 12
  • Position: #466 / 512
  • Number of attempts: 3
Dmitry Teslenko
Twitter:

entered into 42 challenges

contributed 0 challenges