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]

29684 active golfers, 358507 entries, 498 challenges

Open VimGolf challenges

Increment, increment, increment.... - 530 entries

Vim likes macros

readability - 298 entries

Make the code readable by adding some spaces

Add to end of each line... kinda - 280 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?

Wrap the text of an email message to 79 characters - 521 entries

You're replying to an email with silly long lines. Clean them up.

ASCII box - 303 entries

Don't forget to fix typos!

NATO phonetic alphabet - 429 entries

Transform the series of words into a list.

vim = 22 / 7 - 408 entries

pi square vim

Flip the bit - 92 entries

Change the specific 0 to a 1.

Vim tetris - 347 entries

Vim can play tetris too!

citizen_hacks_2019_challenge4 - 62 entries

For the Citizen Hacks 2019 Vim competition.

replace 2nd column blanks with values in same column if blank - 200 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.

Reformat a C golf submission - 492 entries

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

Reverse and double space - 424 entries

Reverse the order of the given lines and double space everything

Logging with key - 280 entries

Sometimes it is better to log with meaningful key

Pretty multi-line bash - 210 entries

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

lipsum lines - 245 entries

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

Split the words - 345 entries

Add the spaces manually if you must, but if you use Vim's spell checking feature wisely, I think you'll save a LARGE number of strokes.

PHP Array Syntax -> MailChimp Merge Syntax - 440 entries

I recently needed to send an e-mail to our marketing department listing allowed merge tags for our MailChimp campaigns. The allowed merge tags were determined from a PHP array in one of our PHP classes. I transformed the PHP class to MailChimp's syntax and sent the e-mail. It was, however, a long, laborious process. I'm still fairly new to Vim and would love to see how an expert Vim user would tackle one of my own, real-world problems. Thanks and have fun!

Interactive git rebase changing commands - 155 entries

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

Letterbox - 83 entries

Make a box!

Stairs Indenting - 384 entries

Indent each line with <line number> whitespaces.

Delete unwanted lines - 350 entries

Delete all lines which does not end in "o.."

A simple change - 377 entries

Just change the numbers in the most efficient way ...

Shuffle puzzle - 302 entries

Sort the lines in each indent group, and sort the groups. That's the pattern. Or just move lines around manually to get a better score.

Context insensitive completion 0 - 461 entries

Buried in the lines you're not supposed to add is the line "Add this line!" Add that line to the top of the file.

Pairs of numbers - 340 entries

Line 1 represents x, line 2 y-data. Bring the corresponding pairs in the form "[x,y]\n"

Sorting paragraphs - 455 entries

Order the paragraphs correctly, per prefixed index

Text to HTML Table - 156 entries

Turn the plain text table to an HTML table.

Replacing some words - 405 entries

How fast could it be?

Add fold markers to a .c file - 447 entries

Fold markers can make it easier to navigate source code. Add them to this .c file.

Comparing Schema With Diff - 50 entries

Sometimes databases output things differently one to another. Fixing things that are out of order will make the diffs more usable.

7th Birthday - 180 entries

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

Going underground.... - 303 entries

Simple reformatting: in this case changing from the format London underground supplies its customers with, to the format that Google Calendar likes...

Generate English Alphabets - 425 entries

Start with a, get up to z.

Indentation - 420 entries

Indent each line according to the right number of spaces it needs.

Line Zipper - 402 entries

Zip/pair related lines.

The Quick Brown Fox Jumps Over The Lazy Vim - 344 entries

Someone has vandalized this text file and replaced the beginning character of one word in each line with a Big "X." Please remove the big X's, and fix each line to read "The Quick Brown Fox Jumps Over The Lazy Dog."

Sort the VimGolf challenges by popularity - 319 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!

Case preserving word replacement - 395 entries

Half way through my project, my people turned into dogs. Now I have to change everything in my source.

Context Insensitive completion 1 - 405 entries

Finish writing this simple Python HTTP server.

you're stuck on jQuery < 1.7 - 325 entries

replace calls to jQuery 1.7+'s `on` with calls to pre 1.7 `bind`

Insert a Markdown link - 392 entries

Put a link in a markdown document, using the after-the-paragraph format.

vim1001 - 244 entries

change number 1001 into a "vim1001 sequence". (My first challenge, hope it is not too bad... )

Santa's naughty / nice list - 75 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.

Reverse and count - 384 entries

Someone typed things upside down and now a Vim ninja needs to reverse the lines and count how many there are.

Triangular Numbers - 64 entries

Generate the first 50 triangular numbers.

Separate the lines - 131 entries

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

Add Go XML to structure tags - 131 entries

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

Rotating Philosophers Problem - 367 entries

Can you help the philosophers find a good place to sit before they get five forks and spaghetti?

Hatsuyume - 368 entries

http://en.wikipedia.org/wiki/Hatsuyume

VimGolf Chatter