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]

21782 active golfers, 223575 entries, 385 challenges

Open VimGolf challenges

SFD-ROC: Pipe Dreams - 93 entries

Move the pipes so they match the output.

Word Blender - 118 entries

The insides of long words seem to have been run through the blender. Can you fix this famous tale, brave knight?

Format the output - 95 entries

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

TAR archive pretty print - 10 entries

Will you use isk ?

Roman numerals - 57 entries

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

Square numbers - 53 entries

Boring math puzzle.

Lenny Spiral - 8 entries

Make one lenny into an infinite army of lennys.

paste indent correction - JS - 75 entries

You copy some javascript code from a website and paste it into vim, it does not look good!

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.

It's a factor - 75 entries

Flaunt your macro prowess by factoring some numbers. Too hard? It takes less than 30 strokes, I promise.

SQL to YAML - 32 entries

Should be easy with vim, or not?

ascii-art diamond - 27 entries

Simple ascii-art diamond. The grid is 40x40.

Lower cased and dashed strings - 39 entries

As I have to generate big fixtures files, I wanted to find a way to format input data the way described by start and end files. Especially the lower-cased-and-dashed ids Not so good to find a pure Vim way, that's why I submit this challenge ;)

Linear congruential generator - 103 entries

http://en.wikipedia.org/wiki/Linear_congruential_generator

Remove Accent off the Letter - 100 entries

Remove all the accent from extremely accented statements.

Execute immediate SQL - 72 entries

Sql string tranformation ...

Not enough Ps - 43 entries

Different type of code

Create an alphabet diamond - 74 entries

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

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

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

SFD-ROC: ROT13 Phonics - 70 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.

Before there was Farmville... - 90 entries

There was old MacDonald. For my toddler. The first Vim sing-a-long?

PHP <--> Java class conversion Part 2 - 83 entries

Same class but reverse!

Lookahead and Lookbehind - 62 entries

Look everywhere

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

Transposition - 66 entries

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

Python: Lots of function arguments - 66 entries

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

Flip the chessboard - 66 entries

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

Tiny column alignment - 37 entries

Align using the four blocks, don't forget to lowercase and have fun!

Create bison tokens - 30 entries

Create tokens for bison out of a known list of words

Greek column realign - 40 entries

Oops one letter is missing! Shift down the second column to insert nu letter. Symbol can be entered using: <C-K>n*

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

Hanging Indent for Footnotes - 57 entries

Format this footnote (in kramdown syntax) so that it has hanging indent.

SFD-ROC: ASCII Logo Border - 66 entries

Draw a border around this familiar logo ;)

C to VimDict - 38 entries

Convert a C data structure to a Vimscript dictionary.

Dumb to smart - 80 entries

Turn dumb quote to smart vim's way.

Sierpinski's Triangle - 62 entries

Build the famous fractal, Sierpinski's Triangle.

Palindrome numbers - 10 entries

For each number compute its associated palindrome. First number (first line) has been eaten! #prime

Circle of Fifths with Sharps - 61 entries

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

Add links to an existing HTML table - 59 entries

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

Remove hard line breaks - 34 entries

Text files with Hard breaks are not good for e-readers. We need remove all hard line breaks and have long lines.

Here, piggy, piggy... - 75 entries

Youay owknay atwhay otay oday...

Five Pillars - 43 entries

Arrange all words in a table with 5 columns. The minimal space between words in columns is 2 spaces. Columns do have varying width.

JSON string rotation - 35 entries

Right value strings are misplaced. Just rotate them! I'm too kind with you guys and didn't included "strings with \" in it"!

fib.c cleanup - 54 entries

cleanup the file

Carriage return - 40 entries

I have some raw data from terminal output which uses carriege return for formatting. Carriage return sets the pointer to the first character on the line, and subsequent characters will overwrite what was there before. The challange is to simulate the terminal behaviour in vim. I'm kind of unsure if I should have skipped lines 9 and 15, since there might be some interesting solutions which are not that generic. Happy Golfing!

Binary and Increment - 32 entries

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

Enharmonic Equivalents - 52 entries

Transform # and b to digraphs

Coordinates placeholder - 49 entries

Place coordinates instead of target search.

Untangle my tail, please! - 43 entries

You know, this words were playing to chase their tails and Oops! What happened? Now we have a complete mess, their tails are totally tangled, can you please help them to untangle their tails?

VimGolf Chatter