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]

23493 active golfers, 251886 entries, 409 challenges

Open VimGolf challenges

Sort the VimGolf challenges by popularity - 246 entries

"Sort by popularity" is a good order to play the challenges. Not perfect, but you could do a lot worse. ;) Input is a sample copy-pasted from vimgolf.com. Some of the challenge names have digits that will get in your way, so read ":help :sort" for hints on sorting with a regex. When you're done, try your solution on the full list!

learn vim in short time - 178 entries

so happy to learn vim.because vim is awesome

Neither Fizz nor Buzz - 188 entries

Not your regular increment macro! The gaps are tricky.

Restore order to the alphabet - 149 entries

The numbers are OK. The letters are wonky.

Sort entries based on date - 296 entries

Sort some entries in a Ledger-file based on date.

Change attribute to getter - 84 entries

Wrap attributes with a getter method.

Refactor static member invocation - 174 entries

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

Change your calendar - 239 entries

Happy New Year!

Table Reshuffle - 316 entries

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

abcd > a b c d - 239 entries

transform the single spaces into 4 spaces repeat for each line

Reformat long lines - 312 entries

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

Free hyphen! - 111 entries

Just like "Inner hyphens", but I'm giving you a free hyphen to play with. Will your solution be any different?

Shift down - 162 entries

Number words are back.

Inner hyphens - 110 entries

Yet another hyphen challenge. Adding 5 hyphens to a file shouldn't be too hard.

Get rid of html tags - 303 entries

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

Wget failed to download redirections - 153 entries

Output of a wget session, where 302 where not properly handled due to certificate problems, has been saved to a file. Keep the correct URLs to start again downloading.

create arrows in a list - 63 entries

Add arrow at same distance

remove all lines in first part - 141 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!

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!

Suffix sort - 163 entries

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

The holy-grail may help - 295 entries

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

Create Leading Zeros - 192 entries

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

Enumerate words - 219 entries

Enumerate the unique words in order.

Extract HTML option values from tag values - 73 entries

Generate HTML option values from the text in the option tag. If the text contains multiple words, replace the spaces with an underscore and convert all capital letters to small letters.

Number an outline - 199 entries

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

Compile C - 275 entries

You might have to get clever to do this one.

Alphabetize the directory - 252 entries

Put the contacts and their information in alphabetical order.

Deleting folded text - 274 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.

Sorting a glossary - 100 entries

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

Format java properties - 63 entries

Format java properties to a different format. The value which is the string following the first '=' cannot & should not change. All periods in the key get replaced with an underscore "_" and get a prefix of "b_".

increment by column in XML - 138 entries

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

Prime Numbers - 263 entries

List the first 100 prime numbers.

Subtraction - 147 entries

Solve the equations.

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

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!

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

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

Pretty format for variable declarations - 128 entries

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

82 bottles of beer on the wall - 243 entries

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

expand a list comprehension (python) - 240 entries

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

Python to Ruby - 188 entries

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

Back to the roots - 36 entries

Johnny has a file with more integers. He wants to change each number with its square root. Can you help him?

Round Round - 240 entries

Round Round

Manual SQL - 92 entries

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

Recursively Palindrome - 221 entries

Note that there are 2^6-1 characters.

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

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

Sort the cardinal numbers - 211 entries

Maybe a simple challenge.

Hidden Message - 44 entries

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

VimGolf Chatter