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

Create Leading Zeros - 232 entries

Create leading zeros only for id columns. Please use generic approach!

  • Best score: 23
  • Best player score: 31
  • Position: #47 / 79
  • Number of attempts: 1
Sierpinski's Triangle - 83 entries

Build the famous fractal, Sierpinski's Triangle.

  • Best score: 25
  • Best player score: 26
  • Position: #6 / 25
  • Number of attempts: 2
Swap assigned value - 614 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 10
  • Position: #4 / 247
  • Number of attempts: 2
attr_aligner - 3444 entries

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

  • Best score: 19
  • Best player score: 30
  • Position: #348 / 692
  • Number of attempts: 1
Fibonacci Triangles - 49 entries

Triangles

  • Best score: 40
  • Best player score: 66
  • Position: #20 / 20
  • Number of attempts: 1
Coordinates placeholder - 62 entries

Place coordinates instead of target search.

  • Best score: 22
  • Best player score: 24
  • Position: #14 / 36
  • Number of attempts: 1
REDRUM - 149 entries

If you remember "The Shinning", the first time you saw the bloody word REDRUM you probably thinked "What the Hell is that?" Well, then you know that you need a little help from a looking-glass to make sense of it. Now it's time to use vim like a mirror to reveal the message.

  • Best score: 14
  • Best player score: 17
  • Position: #34 / 61
  • Number of attempts: 2
Enumerate words - 248 entries

Enumerate the unique words in order.

  • Best score: 23
  • Best player score: 25
  • Position: #8 / 88
  • Number of attempts: 4
Execute immediate SQL - 85 entries

Sql string tranformation ...

  • Best score: 60
  • Best player score: 74
  • Position: #20 / 30
  • Number of attempts: 3
Harder than "abcd > a b c d" - 76 entries

Not as easy as the last challenge. This time, just one space between a and b, up to 25 spaces between y and z. (Removed some lines; diff was too long.)

  • Best score: 15
  • Best player score: 24
  • Position: #25 / 39
  • Number of attempts: 2
Circle in a square - 140 entries

Probably looks more like "Egg in a rectangle" in most fonts, but it's actually 23x23.

  • Best score: 23
  • Best player score: 54
  • Position: #36 / 52
  • Number of attempts: 1
Transposition - 76 entries

Transpose the original lines in separate columns, one for each line.

  • Best score: 31
  • Best player score: 40
  • Position: #13 / 29
  • Number of attempts: 3
Groups magic - 146 entries

Regexp or macros for string converting: (a) -> ___ (abc) -> ____ (abcd) -> ______ All in the '(' replace to _ multiply by char count + ()

  • Best score: 13
  • Best player score: 15
  • Position: #71 / 88
  • Number of attempts: 1
Prefixes and suffixes - 591 entries

Generate all prefixes of "vimchallenge", then all suffixes.

  • Best score: 17
  • Best player score: 26
  • Position: #72 / 192
  • Number of attempts: 1
Refactor arguments into object argument - 161 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 53
  • Position: #11 / 65
  • Number of attempts: 3
Circle of Fifths with Sharps - 93 entries

Display a list of the Circle of Fifths with corresponding solfege syllables with sharps. Handling spaces may be tricky.

  • Best score: 24
  • Best player score: 31
  • Position: #23 / 35
  • Number of attempts: 2
Dehamlizing - 179 entries

Change this piece of HAML code back into erb

  • Best score: 32
  • Best player score: 37
  • Position: #18 / 69
  • Number of attempts: 2
Changing URL path in CSS - 124 entries

What's the quickest way to swap out all the URLs in a CSS file? Is it wasted keystrokes using look-behinds and look-aheads? (I'm sorry for the delete/report--I made a mistake with the last one requiring an ugly search for graphic to replace with images. I just intended this to be a simple search and replace that might possibly generate some macros or normals solutions that are quicker)

  • Best score: 40
  • Best player score: 40
  • Position: #19 / 58
  • Number of attempts: 4
Checkerboard case pattern - 144 entries

All the squares are white. Make some of them black. But only the right ones.

  • Best score: 15
  • Best player score: 16
  • Position: #9 / 57
  • Number of attempts: 3
NATO phonetic alphabet - 498 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 21
  • Position: #69 / 189
  • Number of attempts: 3
Create a pandoc compatible table - 181 entries

In [this vimcast][1], a featured gist from Tim Pope shows how to quickly make a simple table structure. How fast can you convert it to pandoc's markdown style? [1]: http://vimcasts.org/episodes/aligning-text-with-tabular-vim/

  • Best score: 32
  • Best player score: 36
  • Position: #19 / 53
  • Number of attempts: 4
Printable ASCII characters - 121 entries

From a blank input, print all 95 printing ASCII characters one per line, from space to tilde.

  • Best score: 22
  • Best player score: 26
  • Position: #11 / 41
  • Number of attempts: 3
A simple change - 434 entries

Just change the numbers in the most efficient way ...

  • Best score: 12
  • Best player score: 14
  • Position: #71 / 187
  • Number of attempts: 3
Add links to an existing HTML table - 73 entries

Add these links at that top to the respective table cell. First link, first cell, etc.

  • Best score: 42
  • Best player score: 75
  • Position: #25 / 28
  • Number of attempts: 1
SFD-ROC: Tic-Tac-Toe - 132 entries

Tic-Tac-Toe You are 'X', and it is your turn. Stop 'O' from winning, and complete the game. Draw a diagonal line through your winning row of three X's.

  • Best score: 25
  • Best player score: 29
  • Position: #12 / 50
  • Number of attempts: 3
SFD-ROC: The Quick Brown Fox - 168 entries

Someone has vandalized our text (again). Please fix to read: The Quick Brown Fox Jumps Over The Lazy Dog.

  • Best score: 24
  • Best player score: 29
  • Position: #83 / 100
  • Number of attempts: 2
Extract text from xml - 106 entries

Extract text from xml file (ignoring commented out elements) and create a one line regex.

  • Best score: 28
  • Best player score: 35
  • Position: #15 / 43
  • Number of attempts: 4
The Quick Brown Fox Jumps Over The Lazy Vim - 400 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

  • Best score: 8
  • Best player score: 10
  • Position: #32 / 187
  • Number of attempts: 2
Complete the circuit grid! - 81 entries

Continuing from the last challenge, add additional rows to the grid. Change each of the names from 'A1'...'A10' to 'B1'...'B10', 'C1'...'C10', etc, and for each new row add 0.7 to the X values in the (X Y) at the end of each line.

  • Best score: 49
  • Best player score: 56
  • Position: #9 / 28
  • Number of attempts: 2
SFD-ROC: ASCII Logo Border - 70 entries

Draw a border around this familiar logo ;)

  • Best score: 20
  • Best player score: 24
  • Position: #13 / 30
  • Number of attempts: 3
lamb had a little Mary - 582 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

  • Best score: 16
  • Best player score: 25
  • Position: #34 / 161
  • Number of attempts: 3
SFD-ROC: vimvimvim - 1569 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

  • Best score: 8
  • Best player score: 9
  • Position: #149 / 437
  • Number of attempts: 4
SFD-ROC: Pipe Dreams - 99 entries

Move the pipes so they match the output.

  • Best score: 12
  • Best player score: 18
  • Position: #33 / 44
  • Number of attempts: 1
Chucking wood - 103 entries

An exercise in compressing repetitive text. For this challenge, any entry that uses keys outside the main row (such as arrow keys, Home, End, Delete, etc.) will be removed. (Esc is OK, though you should be using C-[ anyway.)

  • Best score: 51
  • Best player score: 57
  • Position: #19 / 45
  • Number of attempts: 2
Stairs Indenting - 446 entries

Indent each line with <line number> whitespaces.

  • Best score: 12
  • Best player score: 14
  • Position: #91 / 193
  • Number of attempts: 1
Unwrap the text of an email message - 184 entries

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

  • Best score: 16
  • Best player score: 23
  • Position: #38 / 72
  • Number of attempts: 1
Python to Ruby - 195 entries

Convert this Python code to Ruby. NOTE: This program likely won't run.

  • Best score: 24
  • Best player score: 27
  • Position: #24 / 58
  • Number of attempts: 3
Cleanining up 80 column concatenated text - 188 entries

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

  • Best score: 31
  • Best player score: 33
  • Position: #25 / 76
  • Number of attempts: 4
Convert pandoc unordered list to a numbered list - 163 entries

I know it's possible to use #. in pandoc to auto-generate numbered lists, but then it's not easy to tell how many items there are when reading it in Markdown. How fast can you make the switch?

  • Best score: 20
  • Best player score: 24
  • Position: #21 / 56
  • Number of attempts: 2
Create an alphabet diamond - 79 entries

Here's a brain teaser to keep things interesting...

  • Best score: 40
  • Best player score: 54
  • Position: #11 / 30
  • Number of attempts: 6
Let's play some Ivmgolf - 1084 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 9
  • Position: #166 / 440
  • Number of attempts: 2
you're stuck on jQuery < 1.7 - 335 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

  • Best score: 25
  • Best player score: 26
  • Position: #22 / 110
  • Number of attempts: 5
Inconsistent real estate paste - 184 entries

Format a hand-typed real estate listing that uses inconsistent punctuation into four sections

  • Best score: 24
  • Best player score: 26
  • Position: #17 / 55
  • Number of attempts: 3
Vertical Limit - 2436 entries

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

  • Best score: 21
  • Best player score: 23
  • Position: #197 / 735
  • Number of attempts: 6
Make the circuit grid! - 85 entries

Copy this command for a circuit layout program to create 10 total smd commands. Increment the number in quotes to name each pad, and add 0.7 to each of the (X Y) coordinates at the end of each line.

  • Best score: 26
  • Best player score: 28
  • Position: #31 / 48
  • Number of attempts: 2
Aligning function arguments to match a specific coding style - 220 entries

Most projects have specific coding style guidelines. In this case, the argument list must be broken into a new line for each argument, with the argument names right aligned, taking into account pointers.

  • Best score: 16
  • Best player score: 23
  • Position: #51 / 67
  • Number of attempts: 2
Exchanging Quotes - 820 entries

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

  • Best score: 30
  • Best player score: 32
  • Position: #60 / 224
  • Number of attempts: 7
Switch function arguments - 2064 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #223 / 647
  • Number of attempts: 3
Append semicolon after expressions - 1002 entries

Some lines need the semicolon, some don't.

  • Best score: 11
  • Best player score: 12
  • Position: #169 / 401
  • Number of attempts: 3
Reverse and double space - 489 entries

Reverse the order of the given lines and double space everything

  • Best score: 14
  • Best player score: 16
  • Position: #94 / 194
  • Number of attempts: 5
Remove noise from HTTP log - 693 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 16
  • Position: #162 / 270
  • Number of attempts: 1
Remove semicolons after expressions - 628 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

  • Best score: 6
  • Best player score: 8
  • Position: #187 / 258
  • Number of attempts: 1
Format the output - 145 entries

Sometimes your standard out is a little hard to read. Take this multilevel hash and make it human readable.

  • Best score: 35
  • Best player score: 43
  • Position: #20 / 39
  • Number of attempts: 2
Calculate the table totals - 130 entries

Go ahead... commit the treachery of using vim as a spreadsheet.

  • Best score: 33
  • Best player score: 34
  • Position: #14 / 43
  • Number of attempts: 3
Édouard M'tou
Twitter:

entered into 54 challenges

contributed 0 challenges