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]

23264 active golfers, 247717 entries, 404 challenges

Open VimGolf challenges

Space out the alphabet - 1289 entries

Put 3 spaces between adjacent letters.

Order and join - 701 entries

There's something special about the input order.

Array Transposition - 121 entries

Transpose four arrays into two.

Vertical Limit - 2052 entries

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

Whitespace, empty lines and tabs - 2517 entries

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

Saving the hashes(#) - 1686 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 - 873 entries

Basic comment reformatting

Align commas - 760 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 - 1791 entries

How to switch two arguments of a function.

Letter case trickery - 1413 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 - 696 entries

Four is NOT 1. One is 1.

simple format (3) - 36 entries

reverse two column values!

Make it more readable - 1718 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

Fix the XML - 836 entries

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

Numbering a List - 1707 entries

Pretty simple, number the list.

Do you demand a shrubbery? - 985 entries

Use :redir and crush the emacsgolfers.

Count both ways - 854 entries

Right AND down.

SFD-ROC: vimvimvim - 1249 entries

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

Array propagate - 216 entries

Complete the array with the keys as part of the value

Shebangs for all - 1563 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.

Todo list specification - 278 entries

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

camel riding - 678 entries

add a prefix on some camelCase variables

From A to B - 487 entries

Mirror and change this text block

Remember VimGolf Rules ! - 181 entries

Rules, ... and don't forget !

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.

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.

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.

Create a table - 223 entries

Convert the given input into a formatted table

Gray area - 614 entries

It's a golf metaphor or something.

Let's play some Ivmgolf - 874 entries

Oops, I spelled that wrong.

The Cake is a Lie - 1106 entries

Correct the capitalization of each word

Simple addition - 217 entries

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

Hello ${world} - 205 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

Two become one - 653 entries

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

Sort and add attributes - 1059 entries

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

Ruby 1.9 hashes - 1038 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 - 838 entries

Some lines need the semicolon, some don't.

Reconstruct the Sentence - 1010 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

Stairstep digits - 205 entries

Remove the evens. Double the odds.

Paragraph sort - 305 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

Nesting SASS - 208 entries

Move a block inside another block and indent it

On Being Stylish - 50 entries

Your PR cannot be accepted if you don't follow our corporate style guide.

VimGolf Chatter