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]

39587 active golfers, 470522 entries, 603 challenges

Open VimGolf challenges

Swap assigned value - 647 entries

Simple problem but looking for interesting solutions.

Groups magic - 158 entries

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

Block Fun 1 - 210 entries

Manipulate the columns to produce desired result.

fib.c cleanup - 68 entries

cleanup the file

Harder than "abcd > a b c d" - 95 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.)

abcd > a b c d - 291 entries

transform the single spaces into 4 spaces repeat for each line

lamb had a little Mary - 607 entries

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

Python: Lots of function arguments - 119 entries

The function definition is too long for one line. The modeline helps you with some typical Python indent settings.

Checkerboard case pattern - 164 entries

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

Readable Rubyhash - 267 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

Chucking wood - 125 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.)

Flip the chessboard - 95 entries

White's turn is over. Flip the board to black's perspective. I added coordinates to frustrate you.

Extract text from xml - 127 entries

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

Printable ASCII characters - 142 entries

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

A simple change - 461 entries

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

Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

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

Sort by your own sum - 85 entries

Same numbers as last time, but you'll have to add them yourself.

Sort by sum of numbers in a line(?) - 67 entries

The lines with the biggest sums need to be at the top. The sums are on the right, which makes life hard. Maybe you can find a feature that will do all the work for you...

Presidential Sorting - 51 entries

Given a nice CSV formatted arrangement of the Presidents of the United States, we need to print out an alphabetical list in pretty columns. Prove that vim can conquer this basic Excel task!

Add links to an existing HTML table - 97 entries

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

Stairs Indenting - 473 entries

Indent each line with <line number> whitespaces.

Python to Ruby - 204 entries

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

you're stuck on jQuery < 1.7 - 362 entries

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

SFD-ROC: ROT13 Phonics - 101 entries

A is for apple, b is for ball, etc... This familiar phonics poem has been rotated 13 characters. Make the letter match the word.

SFD-ROC: vimvimvim - 1606 entries

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

SFD-ROC: ASCII Logo Border - 90 entries

Draw a border around this familiar logo ;)

SFD-ROC: Pipe Dreams - 115 entries

Move the pipes so they match the output.

SFD-ROC: Tic-Tac-Toe - 159 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.

SFD-ROC: The Quick Brown Fox - 193 entries

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

Enharmonic Equivalents - 59 entries

Transform # and b to digraphs

Circle of Fifths with Sharps - 114 entries

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

The name of the game - 665 entries

End up with the name of the game.

NATO phonetic alphabet - 529 entries

Transform the series of words into a list.

The Quick Brown Fox Jumps Over The Lazy Vim - 416 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."

maximun and minimun - 73 entries

Find the maximum and minimum of the rows.

Sierpinski's Triangle - 86 entries

Build the famous fractal, Sierpinski's Triangle.

Dehamlizing - 185 entries

Change this piece of HAML code back into erb

Create an alphabet diamond - 105 entries

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

Convert regular pandoc footnotes to in-line notes - 64 entries

Pandoc extends markdown by allowing footnotes, which are usually represented with a footnote identifier followed later in the document by the footnote itself. But Pandoc also allows inline footnotes without identifiers. How many strokes does it take to convert regular footnotes to inline notes? (NB: I've had trouble figuring out whether text-width makes a difference to Vimgolf in comparing the input and output file. I finally tested this locally using the Vimgolf vimrc and did a "gq" on the entire buffer as the last step. Apologies if I'm making a newbie mistake. First time submitter.)

Complete the circuit grid! - 105 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.

Make the circuit grid! - 101 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.

Convert pandoc unordered list to a numbered list - 166 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?

Vertical Limit - 2538 entries

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

Shuffle and Sort - 229 entries

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

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

Changing URL path in CSS - 138 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)

Inconsistent real estate paste - 213 entries

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

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

Create a pandoc compatible table - 214 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/

VimGolf Chatter