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, 251888 entries, 409 challenges

Open VimGolf challenges

Swap the operands under comparison - 190 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

Fiddle percentages into real numbers - 684 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

replacing each line of a block selection - 2437 entries

replace each line's ../assets/js with /javascripts

Space out the alphabet - 1308 entries

Put 3 spaces between adjacent letters.

Order and join - 717 entries

There's something special about the input order.

Vertical Limit - 2063 entries

transform a succession of one word lines to a an array of strings

Number Sort - 228 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

Whitespace, empty lines and tabs - 2517 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

Santa's naughty / nice list - 47 entries

Christmas is here and Santa hasn't decided who's naughty or nice yet. He's given a list of names to his programmer friend to quickly split the children into naughty and nice. Hint: There's a hidden pattern that might be familiar.

Saving the hashes(#) - 1687 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

comments galore - 883 entries

Basic comment reformatting

Array Transposition - 124 entries

Transpose four arrays into two.

Align commas - 766 entries

There are 15,000 aligning challenges on vimgolf.com, and they're all exactly the same. I hope this one is a little different.

Switch function arguments - 1795 entries

How to switch two arguments of a function.

Letter case trickery - 1416 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

Scrambled numbers - 704 entries

Four is NOT 1. One is 1.

Make it more readable - 1719 entries

Insert blank lines to make it more organized and readable

Make HTML List - 855 entries

Turn the comma separated list into an unordered html list.

C Reformatting - 581 entries

You may use Visual mode... or not. #uppercase

Numbering a List - 1716 entries

Pretty simple, number the list.

Fix the XML - 837 entries

The challenge consists in having a valid xml from an incomplete source.

Do you demand a shrubbery? - 985 entries

Use :redir and crush the emacsgolfers.

SFD-ROC: vimvimvim - 1257 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

Count both ways - 854 entries

Right AND down.

Shebangs for all - 1568 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

Mess in revision history - 936 entries

Help Joe clean up what Steve has cobbled.

Mirror Symmetry - 686 entries

Add backslashes.

Array propagate - 220 entries

Complete the array with the keys as part of the value

camel riding - 678 entries

add a prefix on some camelCase variables

Todo list specification - 284 entries

The every item on the todo list must be done today. Modify the list to reflect that.

From A to B - 487 entries

Mirror and change this text block

Where should I put the Newline? - 785 entries

Help me put the newline.

Hole-in-one - 935 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

Remember VimGolf Rules ! - 186 entries

Rules, ... and don't forget !

remove dupes from array - 1179 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

Paragraph breaks - 389 entries

Swap the blank lines and the aaa lines.

Condensed Cases - 670 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

simple format (3) - 36 entries

reverse two column values!

Alsa configuration - 456 entries

I'm tweaking my ~/.asoundrc file!

Change the content of a string - 1208 entries

This docstring is a complete lie. Fix it.

Gray area - 614 entries

It's a golf metaphor or something.

Let's play some Ivmgolf - 879 entries

Oops, I spelled that wrong.

Create a table - 223 entries

Convert the given input into a formatted table

The Cake is a Lie - 1106 entries

Correct the capitalization of each word

Two become one - 653 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

Simple addition - 217 entries

The right side of the equation is already there. We just need the left one now.

Sort and add attributes - 1059 entries

Sort the states and add the attribute country to each record.

Hello ${world} - 205 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

Ruby 1.9 hashes - 1043 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!

Append semicolon after expressions - 839 entries

Some lines need the semicolon, some don't.

VimGolf Chatter