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]

30687 active golfers, 372803 entries, 513 challenges

Open VimGolf challenges

Format the CSS - 38 entries

You just copied some CSS color names from the web and need to add them to your python module. Create the COLORS variable and assign a dict() with the names as keys and hex-colors as values. BEWARE OF THE TABS!!

Interweave two blocks of text - 530 entries

Suppose you've got data on a list of things from multiple sources. They're all in separate chunks, so how might you create a tabular output?

Remember FizzBuzz? - 548 entries

Output FizzBuzz to 100. Start with nothing.

Reformat most common surnames - 540 entries

Reformat copy-pasted table into a list of the most common surnames

Counting in binary - 405 entries

"a" represents 0; "A" represents 1. Start from zero and count to 15.

Reformat some Python - 534 entries

Fix some very bizarrely laid-out code.

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

Vim likes macros

Angular naming conventions - 279 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!

NATO phonetic alphabet - 438 entries

Transform the series of words into a list.

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.

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

Right Align Part of the line - 49 entries

The challenge is to right align a part of the line - this is useful in some SQL queries where it's more clear which are the fields displayed

readability - 298 entries

Make the code readable by adding some spaces

vim = 22 / 7 - 408 entries

pi square vim

ASCII box - 304 entries

Don't forget to fix typos!

Vim tetris - 347 entries

Vim can play tetris too!

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

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!

Split the words - 346 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.

Logging with key - 281 entries

Sometimes it is better to log with meaningful key

Stairs Indenting - 387 entries

Indent each line with <line number> whitespaces.

lipsum lines - 245 entries

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

Delete unwanted lines - 350 entries

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

C to python code snippet - 30 entries

C code can be easily translated into Python code. However, the difference in syntax can make this process tedious and time-consuming. Can Vim help you here?

A simple change - 377 entries

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

Pretty multi-line bash - 210 entries

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

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.

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.

Sorting paragraphs - 456 entries

Order the paragraphs correctly, per prefixed index

Pairs of numbers - 340 entries

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

add line and index - 48 entries

a missed line and index names need to be added

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.

Flip the bit - 92 entries

Change the specific 0 to a 1.

Interactive git rebase changing commands - 155 entries

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

Generate English Alphabets - 425 entries

Start with a, get up to z.

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

Text to HTML Table - 156 entries

Turn the plain text table to an HTML table.

The Quick Brown Fox Jumps Over The Lazy Vim - 352 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."

Indentation - 420 entries

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

Line Zipper - 403 entries

Zip/pair related lines.

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

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.

Case preserving word replacement - 397 entries

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

Separate the lines - 150 entries

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

citizen_hacks_2019_challenge4 - 63 entries

For the Citizen Hacks 2019 Vim competition.

Count to 100 in word form - 8 entries

Write all the numbers from 1 to 100, using their word forms rather than the digit form. Most of the parts you will need are included in the input file. Use hyphens when appropriate.

Context Insensitive completion 1 - 405 entries

Finish writing this simple Python HTTP server.

VimGolf Chatter