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]

21586 active golfers, 220883 entries, 385 challenges

Open VimGolf challenges

remove all lines in first part - 129 entries

From the second part, remove all lines in the first part. It can be useful when you have done something from a long list, you want to know what is not done yet!

Sorting a glossary - 94 entries

Sort a glossary. Glossary head contains a header phrase ending with ':' and glossary body has multi line text indented with a tab.

Readable Rubyhash - 226 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!

Get rid of html tags - 303 entries

Want to read more about Vim's background? Then get rid of those html tags...

Create Leading Zeros - 188 entries

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

Enumerate words - 219 entries

Enumerate the unique words in order.

increment by column in XML - 138 entries

modify an arbitrary "column" in an xml table by incrementing a an arbitrary placeholder string

Number an outline - 198 entries

The indent and words are right, but the numbers are all wrong.

Interleave lines - 123 entries

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

The holy-grail may help - 280 entries

Can you find it in less than 20 strokes, Arthur?

Subtraction - 145 entries

Solve the equations.

Alphabetize the directory - 249 entries

Put the contacts and their information in alphabetical order.

Deleting folded text - 273 entries

The text below contains three folds. Delete them (and the text inside them). For example: 123 456 /*{{{*/ 789 /*}}}*/ 012 Should become: 123 012 Also, add `aoeuaoeu` to make sure small solutions don't get flagged as cheating.

Compile C - 270 entries

You might have to get clever to do this one.

Word frequency alignment - 195 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

Pretty format for variable declarations - 128 entries

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

Manual SQL - 92 entries

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

Change name of a variable - 136 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.

Change your calendar - 188 entries

Happy New Year!

Prime Numbers - 255 entries

List the first 100 prime numbers.

Python to Ruby - 188 entries

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

Fix the Haiku - 246 entries

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

Top X - 163 entries

The End File is the Top 10 Vimgolf Leaderboard at June 29, 2013. This is a second version, with a great contribution of @udioica. X is ten in Roman,a numeric system in ancient Rome

expand a list comprehension (python) - 240 entries

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

82 bottles of beer on the wall - 233 entries

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

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!

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

Winning streak - 102 entries

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

Parsing with CSV: Unify lines and result. - 157 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?

Assign list - 145 entries

Assign list elements to matrix

Fun With The Diagonal - 66 entries

change the lowercase characters on the main diagonal to uppercase

Refactor arguments into object argument - 155 entries

A relatively common Javascript refactoring.

Java Array2List - 210 entries

Convert an java array initializer into a list.

ASCII Art - 65 entries

how good are you with simple regex?

Block Fun 1 - 158 entries

Manipulate the columns to produce desired result.

Sort the cardinal numbers - 203 entries

Maybe a simple challenge.

swap or reverse - 86 entries

Try to swap or reverse the line as needed.

Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 40 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!

Recursively Palindrome - 204 entries

Note that there are 2^6-1 characters.

Converting group lines from format A to Format B - 19 entries

Convert from one format to another

Test everything! - 96 entries

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

Assign numbers to fields - 75 entries

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

Round Round - 199 entries

Round Round

Dehamlizing - 155 entries

Change this piece of HAML code back into erb

Shuffle and Sort - 159 entries

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

Another Mixed-Up Haiku - 196 entries

VimGolf ... a perfect evening?

Generate Fibonacci Numbers - 192 entries

Use your super vim powers to generate Fibonacci Numbers.

It'ss tooo coold too typpe todaay - 191 entries

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

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

Convert this tiny php class to adequate java one.

Flatten repo - 22 entries

For each git repository (<project> tag) translate name attribute to flatten directory structure. Add path attribute if missing (because checkout hierarchy must be kept). #xml

VimGolf Chatter