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]

28582 active golfers, 338631 entries, 484 challenges

Open VimGolf challenges

Simple addition - 248 entries

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

Replace and keep the case - 369 entries

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

Python challenge - 124 entries

Change the types of the variables in the list from str to float, while keeping the truncation.

HTML to Haml - 757 entries

Help convert this HTML page to Haml.

Reverse Simple Deletion - 736 entries

You did the simple deletion, now reverse it.

Mute the second method of this script - 418 entries

prepend a # infront of every line of the second method

Wrap text in quotes - 311 entries

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

Remove noise from HTTP log - 624 entries

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

The name of the game - 596 entries

End up with the name of the game.

Assignment Alignment - 722 entries

line up the operators. Use spaces, not tabs.

Nesting SASS - 240 entries

Move a block inside another block and indent it

unknown command - 119 entries

I want change 5 words

Combines all items - 255 entries

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

Stairstep digits - 227 entries

Remove the evens. Double the odds.

citizen_hacks_2019_challenge4 - 62 entries

For the Citizen Hacks 2019 Vim competition.

lamb had a little Mary - 535 entries

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

Prefixes and suffixes - 526 entries

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

VimGolfNight - 471 entries

Based on "The name of the game".

Swap assigned value - 518 entries

Simple problem but looking for interesting solutions.

Lisp Condense - 400 entries

Reduce 4 cons selection operations down to one function call.

Braces or Brackets? - 644 entries

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

Happy TvvO - 367 entries

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

Minimalist Limerick - 494 entries

Reproduce this lovely poem.

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.

Generate a list of numbers - 259 entries

Please generate list of numbers from 1 to 20.

120 Degrees - 389 entries

Rotate that triangle.

Reverse characters in a line - 602 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

Flip the bit - 88 entries

Change the specific 0 to a 1.

The meaning - 509 entries

Numbers are fun!

imports alignment (python) - 584 entries

Align as one import per line.

Remove semicolons after expressions - 499 entries

A follow-up for http://vimgolf.com/challenges/4fc9d767d3a0d4000100000e.

Letterbox - 83 entries

Make a box!

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!

Ruby 1.9 compat - 565 entries

Remember when Ruby supported `when <expr> :`? Well, it doesn't in 1.9, so let's make sure we use `then`, without ruining our lovely new hash syntax!

Counting in binary - 405 entries

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

Remember FizzBuzz? - 548 entries

Output FizzBuzz to 100. Start with nothing.

Interweave two blocks of text - 522 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?

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

Reformat most common surnames - 538 entries

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

ASCII box - 303 entries

Don't forget to fix typos!

readability - 292 entries

Make the code readable by adding some spaces

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

Line 'em up! - 280 entries

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

vim = 22 / 7 - 408 entries

pi square vim

Increment, increment, increment.... - 521 entries

Vim likes macros

Vim tetris - 347 entries

Vim can play tetris too!

Reformat some Python - 519 entries

Fix some very bizarrely laid-out code.

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

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

Interactive git rebase changing commands - 155 entries

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

NATO phonetic alphabet - 413 entries

Transform the series of words into a list.

VimGolf Chatter