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]

24368 active golfers, 267711 entries, 424 challenges

Open VimGolf challenges

Interleave lines - 125 entries

This is some kind of « paste -d'\n' c b a ». There are many ways to achieve this.. just find the shortest!

Format java properties - 63 entries

Format java properties to a different format. The value which is the string following the first '=' cannot & should not change. All periods in the key get replaced with an underscore "_" and get a prefix of "b_".

Fix the Haiku - 246 entries

Change this slightly scrambled haiku to its unscrambled form and fix the capitalisation and punctuation along the way.

82 bottles of beer on the wall - 243 entries

Take them down. (sorry, only 82 bottles because the problem size is limited!)

expand a list comprehension (python) - 240 entries

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

Round Round - 240 entries

Round Round

Python to Ruby - 188 entries

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

Pretty format for variable declarations - 128 entries

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

Recursively Palindrome - 221 entries

Note that there are 2^6-1 characters.

Cleanining up 80 column concatenated text - 184 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

Fun With The Diagonal - 84 entries

change the lowercase characters on the main diagonal to uppercase

Sort the cardinal numbers - 211 entries

Maybe a simple challenge.

Parsing with CSV: Unify lines and result. - 162 entries

col1;col2;col3;col4 A;1;4;5 A;3;4; A;1;4; # New output: col1;col2;col3;col4 A;1(2x);3;4(3x);5 any ideas?

Java Array2List - 214 entries

Convert an java array initializer into a list.

Manual SQL - 92 entries

Change select and insert queries to simulate inserting a new record.

Back to the roots - 37 entries

Johnny has a file with more integers. He wants to change each number with its square root. Can you help him?

Test everything! - 111 entries

... and build the desired input data structure. Transform a list of values into a non-trivial format.

Refactor arguments into object argument - 156 entries

A relatively common Javascript refactoring.

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!

Shuffle and Sort - 171 entries

The values where sorted incorrectly. Get them back to how they are supposed to be

Assign list - 145 entries

Assign list elements to matrix

Block Fun 1 - 158 entries

Manipulate the columns to produce desired result.

Winning streak - 105 entries

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

42-header - 36 entries

Rush 42mexican-standoff at 42 school

Cartesian product - 201 entries

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

Generate Fibonacci Numbers - 200 entries

Use your super vim powers to generate Fibonacci Numbers.

Separating firstname & lastname - 102 entries

Seperate named with equal tabs.

Another Mixed-Up Haiku - 196 entries

VimGolf ... a perfect evening?

Hidden Message - 44 entries

Find the hidden message and replace all other characters with spaces.

It'ss tooo coold too typpe todaay - 194 entries

My hands are numb with cold. It's hard to type correctly.

Dehamlizing - 155 entries

Change this piece of HAML code back into erb

PHP <--> Java class conversion Part 1 - 178 entries

Convert this tiny php class to adequate java one.

Assign numbers to fields - 82 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

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

swap or reverse - 87 entries

Try to swap or reverse the line as needed.

constructor - 161 entries

coding a constructor for a simple class

Aligning function arguments to match a specific coding style - 151 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.

formatted text to markdown - 173 entries

You're converting some posts from an old blog to markdown. The formatted text is far closer to the finished product than the html markup, so it seems like a good place to start. Word wrapping seems to be the main area for optimization.

ASCII Art - 69 entries

how good are you with simple regex?

Turn this csv list into queries - 181 entries

Transform each line of this csv file into a MySQL-ready INSERT query.

Complete the hex array data - 174 entries

Do not use external tools(e.g. tac, seq) [My interpretation of Rule #7]

Multiplication table. - 171 entries

Create a multiplication table.

SFD-ROC: The Quick Brown Fox - 140 entries

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

Groups magic - 134 entries

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

Unwrap the text of an email message - 135 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?

Inconsistent real estate paste - 142 entries

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

REDRUM - 131 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.

Winding path - 91 entries

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

Circle in a square - 125 entries

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

Almost encrypted - 164 entries

Convert the first paragraph to be even less readable.

VimGolf Chatter