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]

30737 active golfers, 372891 entries, 513 challenges

Open VimGolf challenges

Array propagate - 289 entries

Complete the array with the keys as part of the value

Ugly spreadsheet copy/paste to CSV - 787 entries

convert an ugly spreadsheet copy/paste into a CSV format.

A Simple One - 870 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

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.

Triangle of arrows - 101 entries

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

Paragraph sort - 391 entries

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

Flodder-challenge - 829 entries

Replace the text the most efficient and win!

Levenshtein distance - 61 entries

Compute distance for each pair. Notice that this recursive implementation is very inefficient. Wagner-Fischer algorithm is iterative and much faster. #vimscript

Hello ${world} - 290 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

Convert Application Output to CSV - 158 entries

Change the application output to comma-separated values

Create a table - 285 entries

Convert the given input into a formatted table

Simple addition - 288 entries

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

HTML to Haml - 759 entries

Help convert this HTML page to Haml.

Replace and keep the case - 389 entries

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

Reverse Simple Deletion - 739 entries

You did the simple deletion, now reverse it.

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.

Assignment Alignment - 722 entries

line up the operators. Use spaces, not tabs.

The name of the game - 597 entries

End up with the name of the game.

Mute the second method of this script - 427 entries

prepend a # infront of every line of the second method

Remember VimGolf Rules ! - 225 entries

Rules, ... and don't forget !

Wrap text in quotes - 322 entries

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

citizen_hacks_2019_challenge5 - 106 entries

For the Citizen Hacks 2019 Vim competition.

Prefixes and suffixes - 533 entries

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

lamb had a little Mary - 538 entries

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

Array Transposition - 166 entries

Transpose four arrays into two.

VimGolfNight - 482 entries

Based on "The name of the game".

Swap assigned value - 525 entries

Simple problem but looking for interesting solutions.

Resort and deup a CSV list - 128 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.

Braces or Brackets? - 644 entries

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

Nesting SASS - 246 entries

Move a block inside another block and indent it

Making 3 line function a one liner. - 22 entries

Simple challenge for frequent action while programming.

Lisp Condense - 414 entries

Reduce 4 cons selection operations down to one function call.

Combines all items - 263 entries

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

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

Minimalist Limerick - 500 entries

Reproduce this lovely poem.

Happy TvvO - 377 entries

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

Stairstep digits - 233 entries

Remove the evens. Double the odds.

120 Degrees - 399 entries

Rotate that triangle.

Line 'em up! - 345 entries

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

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.

imports alignment (python) - 586 entries

Align as one import per line.

The meaning - 515 entries

Numbers are fun!

unknown command - 136 entries

I want change 5 words

Remove semicolons after expressions - 508 entries

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

Generate a list of numbers - 269 entries

Please generate list of numbers from 1 to 20.

Tables, Functions, Sprocs - 106 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.

C# data class to F# record - 51 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.

Python challenge - 128 entries

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

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!

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?

VimGolf Chatter