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]

23759 active golfers, 256527 entries, 415 challenges

Open VimGolf challenges

Sort and add attributes - 1059 entries

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

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!

Simple addition - 217 entries

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

Append semicolon after expressions - 841 entries

Some lines need the semicolon, some don't.

Hello ${world} - 205 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

Reconstruct the Sentence - 1010 entries

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

simple format (3) - 37 entries

reverse two column values!

Stairstep digits - 208 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

Make Fancy Header - 891 entries

Make the header text stand out with surrounding asterisks

Exchanging Quotes - 746 entries

Sometimes you need to exchange a choice of quotes in some code.

Combines all items - 231 entries

For each line that starts with the same number I want to combine its contents

Wrap text in quotes - 276 entries

All the blocks of text should be wrapped in quotation marks.

A Simple One - 828 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

Replace and keep the case - 330 entries

Replace all instance of plugin and Plugin to device and Device.

Python Hello World! Reformatting - 822 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

Mute the second method of this script - 404 entries

prepend a # infront of every line of the second method

Flodder-challenge - 804 entries

Replace the text the most efficient and win!

Ugly spreadsheet copy/paste to CSV - 696 entries

convert an ugly spreadsheet copy/paste into a CSV format.

Interactive git rebase changing commands - 142 entries

How to change the action of some commits in git rebase dialog.

Generate a list of numbers - 235 entries

Please generate list of numbers from 1 to 20.

The name of the game - 579 entries

End up with the name of the game.

Remove noise from HTTP log - 597 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

On Being Stylish - 50 entries

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

Reverse Simple Deletion - 698 entries

You did the simple deletion, now reverse it.

HTML to Haml - 683 entries

Help convert this HTML page to Haml.

Happy TvvO - 344 entries

Don’t forget the past, learn from it. Happy New Year.

Text to HTML Table - 142 entries

Turn the plain text table to an HTML table.

VimGolfNight - 451 entries

Based on "The name of the game".

Assignment Alignment - 660 entries

line up the operators. Use spaces, not tabs.

Lisp Condense - 364 entries

Reduce 4 cons selection operations down to one function call.

replace 2nd column blanks with values in same column if blank - 177 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

Prefixes and suffixes - 485 entries

Generate all prefixes of "vimchallenge", then all suffixes.

Swap assigned value - 489 entries

Simple problem but looking for interesting solutions.

Angular naming conventions - 262 entries

In angular, a directive name follows the camelCase convention. When the directive is used in an HTML template, the words are instead separated by a dash. Go from to the other the fastest!

Braces or Brackets? - 625 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

120 Degrees - 350 entries

Rotate that triangle.

Pretty multi-line bash - 194 entries

Bash line continuations are much prettier when they're column aligned.

Add Go XML to structure tags - 127 entries

The Go programming language can directly map XML to structure fields. Add the correct XML tag after each field.

lamb had a little Mary - 464 entries

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

Separate the lines - 126 entries

Every other line is mixed up. Separate them into their original texts.

Add to end of each line... kinda - 263 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

readability - 285 entries

Make the code readable by adding some spaces

Minimalist Limerick - 448 entries

Reproduce this lovely poem.

Line 'em up! - 275 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

ASCII box - 295 entries

Don't forget to fix typos!

lipsum lines - 239 entries

Convert a quoted block of text into strings in a list.

The meaning - 491 entries

Numbers are fun!

imports alignment (python) - 577 entries

Align as one import per line.

VimGolf Chatter