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]

28134 active golfers, 330676 entries, 477 challenges

Open VimGolf challenges

Pretty multi-line bash - 198 entries

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

Reformat a C golf submission - 488 entries

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

Split the words - 338 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 - 439 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!

Shuffle puzzle - 301 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.

Stairs Indenting - 384 entries

Indent each line with <line number> whitespaces.

Delete unwanted lines - 347 entries

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

A simple change - 370 entries

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

citizen_hacks_2019_challenge6 - 36 entries

For the Citizen Hacks 2019 Vim competition.

Pairs of numbers - 336 entries

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

Context insensitive completion 0 - 450 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.

Replacing some words - 401 entries

How fast could it be?

Sorting paragraphs - 443 entries

Order the paragraphs correctly, per prefixed index

Add fold markers to a .c file - 443 entries

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

7th Birthday - 171 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.... - 298 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 - 424 entries

Start with a, get up to z.

Add Go XML to structure tags - 130 entries

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

Line Zipper - 401 entries

Zip/pair related lines.

Indentation - 418 entries

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

Separate the lines - 129 entries

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

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

Case preserving word replacement - 394 entries

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

vim1001 - 243 entries

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

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

Context Insensitive completion 1 - 397 entries

Finish writing this simple Python HTTP server.

you're stuck on jQuery < 1.7 - 324 entries

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

Kolakoski sequence -- level 1 - 51 entries

Generate the Kolakoski sequence as described by its first 75 terms.

Insert a Markdown link - 389 entries

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

Reverse and count - 382 entries

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

Hash staircase - 36 entries

Can you use a strategy to come up with this pattern?

Hatsuyume - 367 entries

Shuffled numbers - 199 entries

Each number is paired with the number it should follow. That's enough information to put them in order.

NBCU Weekly Challenge - Test - 223 entries

Just testing.

Rotating Philosophers Problem - 360 entries

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

citizen_hacks_2019_challenge1 - 28 entries

For the Citizen Hacks 2019 Vim competition

If-then-else regexp - 37 entries

Rules: - golf is never following golf - vim comes first! Drawing a finite-state machine diagram could help. #regexp

Sort files from hosts - 131 entries

Resume files by host. I hope you enjoy with this challenge

Sorting database text output - 193 entries

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

Change your calendar - 270 entries

Happy New Year!

Mirrored text - 153 entries

backward and forward, and long enough to be challenging

Un"finnish"ed Work - 102 entries

Replace å by a, ä by a and ö by o.

FoodCritic023: Prefer conditional attributes - 161 entries

FoodCritic ( is a lint tool for your Chef ( cookbooks. FC023 indicates that you should prefer Chef guards over Ruby conditions. This challenge expects you to be able to fix this issue in a sample cookbook, given the FoodCritic output: ================================================================ FC023: Prefer conditional attributes: cookbooks/foo/recipes/default.rb:25 ================================================================ See for more details about the changes being made.

For all cases. - 106 entries

In this case... change it! :) Watch the line.

Sort entries based on date - 304 entries

Sort some entries in a Ledger-file based on date.

Table Reshuffle - 325 entries

Fix the column order in this table... also append the new 'username' column.

learn vim in short time - 193 entries

so happy to learn vim.because vim is awesome

Start coding format - 123 entries

I used to start coding with following format: int main(){ -(cursor here) }

Array of characters - 131 entries

We all copy paste things off the internet, but the syntax doesn't look right. Fix it as fast as possible.

Neither Fizz nor Buzz - 200 entries

Not your regular increment macro! The gaps are tricky.

VimGolf Chatter