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]

30149 active golfers, 368301 entries, 507 challenges

Open VimGolf challenges

Array propagate - 268 entries

Complete the array with the keys as part of the value

Python Hello World! Reformatting - 860 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.

Flodder-challenge - 829 entries

Replace the text the most efficient and win!

Paragraph sort - 356 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

Hello ${world} - 271 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

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

Convert Application Output to CSV - 140 entries

Change the application output to comma-separated values

HTML to Haml - 759 entries

Help convert this HTML page to Haml.

Create a table - 266 entries

Convert the given input into a formatted table

Reverse Simple Deletion - 739 entries

You did the simple deletion, now reverse it.

Triangle of arrows - 72 entries

I made this by accident when working on another challenge. How would you go about making this?

C# data class to F# record - 48 entries

Converting from C# to F# is not hard, but requires some manual labor. Here you should convert from a C# data class to a F# record.

Simple addition - 263 entries

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

Remove noise from HTTP log - 631 entries

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

Replace and keep the case - 369 entries

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

Assignment Alignment - 722 entries

line up the operators. Use spaces, not tabs.

Remember VimGolf Rules ! - 219 entries

Rules, ... and don't forget !

The name of the game - 597 entries

End up with the name of the game.

Reformat Cura settings - 102 entries

Cura settings are weirdly encoded... After mere replacements, you'll have to enquote two strings (infill_pattern & speed_travel) and dont forget booleans in lowercase. #format #json

Mute the second method of this script - 420 entries

prepend a # infront of every line of the second method

Resort and deup a CSV list - 125 entries

I'm always adding items to a sorted list. There has to be a better way dedup and resort the lists. There are multiple lists with varying lengths to discourage manual sorting. Also Australia's animals are weird.

Wrap text in quotes - 315 entries

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

citizen_hacks_2019_challenge5 - 94 entries

For the Citizen Hacks 2019 Vim competition.

Array Transposition - 160 entries

Transpose four arrays into two.

Prefixes and suffixes - 532 entries

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

lamb had a little Mary - 537 entries

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

Nesting SASS - 242 entries

Move a block inside another block and indent it

Swap assigned value - 525 entries

Simple problem but looking for interesting solutions.

VimGolfNight - 478 entries

Based on "The name of the game".

Braces or Brackets? - 644 entries

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

C to python code snippet - 29 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?

Combines all items - 255 entries

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

Minimalist Limerick - 500 entries

Reproduce this lovely poem.

Stairstep digits - 228 entries

Remove the evens. Double the odds.

Lisp Condense - 401 entries

Reduce 4 cons selection operations down to one function call.

Happy TvvO - 370 entries

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

120 Degrees - 389 entries

Rotate that triangle.

Python challenge - 124 entries

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

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.

unknown command - 126 entries

I want change 5 words

The meaning - 515 entries

Numbers are fun!

imports alignment (python) - 586 entries

Align as one import per line.

Generate a list of numbers - 262 entries

Please generate list of numbers from 1 to 20.

Remove semicolons after expressions - 499 entries

A follow-up for

Ruby 1.9 compat - 566 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!

Tables, Functions, Sprocs - 91 entries

In order to load some scripts into my database in the correct order I need to load tables first (t_), then functions (fn_), then stored procedures (sp_). The order of the t_ lines and the order of the sp_ lines should also match. Reorder the lines so they will load correctly.

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.

Line 'em up! - 306 entries

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

add line and index - 48 entries

a missed line and index names need to be added

VimGolf Chatter