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]

29684 active golfers, 358507 entries, 498 challenges

Open VimGolf challenges

calculations - 199 entries

Complete these (weird) calculations.

Mess in revision history - 1102 entries

Help Joe clean up what Steve has cobbled.

Reconstruct the actual output from my unit test tool report - 95 entries

When a test fails, my unit test tool reports differences between the actual output and the expected output as follow: - line in the expected output but missing in the actual output are prefixed with a dash - unexpected lines in the actual output are prefixed with a plus sign - comments added by the unit test tool are prefixed with a question mark - common lines are showed `as-is` (well, almost;) From that "diff" format, I would like to reconstruct the actual output.

Scrambled numbers - 764 entries

Four is NOT 1. One is 1.

Fix the XML - 921 entries

The challenge consists in having a valid xml from an incomplete source.

change parenthesis - 221 entries

change the pair of braces into a pair of parentheses

Remove quotes after first field - 229 entries

Remove the quotes around each field except for the first field.

C Reformatting - 675 entries

You may use Visual mode... or not. #uppercase

Count both ways - 932 entries

Right AND down.

Song Transcription Oops - 197 entries

When transcribing vocal music to Canjo Tab you can start by finding the lowest note and assigning that to zero and working your way up from there. However, without fail, I tend to miscount the notes and when I am near done I find a lower note. I mark this with a "z". This means I have to increase all the previous ones by 1. just a sting of numbers :)

Build a six - 259 entries

Just enjoy building "a" floors...

remove dupes from array - 1260 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

Quote modules (ver.2) - 112 entries

Complete golang import statement.

Add text at some column - 112 entries

Complete golang struct statement.

Levenshtein distance - 49 entries

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

Mirror Symmetry - 739 entries

Add backslashes.

Hole-in-one - 963 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

Join 'em - 192 entries

This shouldn't be too tough

camel riding - 731 entries

add a prefix on some camelCase variables

Where should I put the Newline? - 830 entries

Help me put the newline.

Change the content of a string - 1270 entries

This docstring is a complete lie. Fix it.

Simple format (2) - 256 entries

try again!

Extract wireshark capture filter - 151 entries

Extract wireshark capture filter from IP plan

Let's play some Ivmgolf - 976 entries

Oops, I spelled that wrong.

Condensed Cases - 729 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

The Cake is a Lie - 1168 entries

Correct the capitalization of each word

From A to B - 533 entries

Mirror and change this text block

citizen_hacks_2019_challenge2 - 140 entries

For the Citizen Hacks 2019 Vim competition.

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

Ruby 1.9 hashes - 1113 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

Sort and add attributes - 1113 entries

Sort the states and add the attribute country to each record.

Gray area - 669 entries

It's a golf metaphor or something.

Number Sort - 268 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

Append semicolon after expressions - 899 entries

Some lines need the semicolon, some don't.

Around the clock - 155 entries

You'll want to use 2 special commands to complete this. If you haven't yet, read through 'input.txt', especially :help simple-changes

Reconstruct the Sentence - 1042 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

Swap the operands under comparison - 240 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

Two become one - 692 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

Paragraph breaks - 431 entries

Swap the blank lines and the aaa lines.

Alsa configuration - 478 entries

I'm tweaking my ~/.asoundrc file!

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?

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.

Todo list specification - 328 entries

The every item on the todo list must be done today. Modify the list to reflect that.

Make Fancy Header - 929 entries

Make the header text stand out with surrounding asterisks

Exchanging Quotes - 779 entries

Sometimes you need to exchange a choice of quotes in some code.

Array propagate - 268 entries

Complete the array with the keys as part of the value

Triangle of arrows - 72 entries

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

Ugly spreadsheet copy/paste to CSV - 768 entries

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

A Simple One - 862 entries

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

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

VimGolf Chatter