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]

22293 active golfers, 231047 entries, 392 challenges

Open VimGolf challenges

Refactor static member invocation - 161 entries

Someone used a static method. Refactor the method into a static import while fixing the assertion.

Table Reshuffle - 310 entries

Fix the column order in this table... also append the new 'username' column.

abcd > a b c d - 232 entries

transform the single spaces into 4 spaces repeat for each line

Suffix sort - 163 entries

Sort from the end of the line, as if the letters in each line were reversed.

Reformat long lines - 305 entries

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

Get rid of html tags - 303 entries

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

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

Create Leading Zeros - 192 entries

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

Sorting a glossary - 98 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.

Number an outline - 199 entries

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

The holy-grail may help - 289 entries

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

increment by column in XML - 138 entries

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

Alphabetize the directory - 252 entries

Put the contacts and their information in alphabetical order.

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!

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.

Subtraction - 145 entries

Solve the equations.

Hidden Message - 43 entries

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

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

Top X - 177 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

Prime Numbers - 261 entries

List the first 100 prime numbers.

42-header - 28 entries

Rush 42mexican-standoff at 42 school

Pretty format for variable declarations - 128 entries

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

Change your calendar - 189 entries

Happy New Year!

Sort yaml structures alphabetically by root key names - 25 entries

sometimes we want to sort structures alphabetically in yaml files

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.

Fix the Haiku - 246 entries

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

Manual SQL - 92 entries

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

Python to Ruby - 188 entries

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

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!

Test everything! - 109 entries

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

Fun With The Diagonal - 72 entries

change the lowercase characters on the main diagonal to uppercase

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?

Winning streak - 102 entries

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

Java Array2List - 210 entries

Convert an java array initializer into a list.

Assign list - 145 entries

Assign list elements to matrix

Refactor arguments into object argument - 155 entries

A relatively common Javascript refactoring.

Sort the cardinal numbers - 203 entries

Maybe a simple challenge.

Block Fun 1 - 158 entries

Manipulate the columns to produce desired result.

Recursively Palindrome - 204 entries

Note that there are 2^6-1 characters.

ASCII Art - 67 entries

how good are you with simple regex?

Separating firstname & lastname - 96 entries

Seperate named with equal tabs.

Assign numbers to fields - 80 entries

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

Cartesian product - 201 entries

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

swap or reverse - 86 entries

Try to swap or reverse the line as needed.

Generate Fibonacci Numbers - 199 entries

Use your super vim powers to generate Fibonacci Numbers.

VimGolf Chatter