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

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!

42-header - 26 entries

Rush 42mexican-standoff at 42 school

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!

Create Leading Zeros - 188 entries

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

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.

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.

The holy-grail may help - 280 entries

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

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!

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.

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!

Manual SQL - 92 entries

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

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!)

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

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!

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

Refactor arguments into object argument - 155 entries

A relatively common Javascript refactoring.

Fun With The Diagonal - 67 entries

change the lowercase characters on the main diagonal to uppercase

Java Array2List - 210 entries

Convert an java array initializer into a list.

Block Fun 1 - 158 entries

Manipulate the columns to produce desired result.

Sort the cardinal numbers - 203 entries

Maybe a simple challenge.

Recursively Palindrome - 204 entries

Note that there are 2^6-1 characters.

ASCII Art - 65 entries

how good are you with simple regex?

swap or reverse - 86 entries

Try to swap or reverse the line as needed.

Test everything! - 96 entries

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

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!

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

Assign numbers to fields - 75 entries

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

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.

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.

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

Convert from one format to another

VimGolf Chatter