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]

28138 active golfers, 330783 entries, 477 challenges

Open VimGolf challenges

Yo To Hello - 39 entries

Simply Turn Yo To Hello

prepend * to every non-blank line - 2609 entries

Prepend an asterisk to every non-blank line in the input file.

Add semicolons - 7755 entries

Simply add a semicolon at the end of each line

Replace pattern with 1, 2, 3, ... on each line - 267 entries

For each line replace a search pattern (in this case $) with numbers starting at 1 and then increasing by 1 for each replaced match. a$b$c$ -> a0b1c2

Simple, Practical, and Common - 29826 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

Box it - 6049 entries

Create a box around a line.

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

One number per line - 16262 entries

Just give me the numbers.

Alphabet soup - 136 entries

Create a column of all alphabet characters organized in a funky way

I forgot quotes - 14275 entries


Get mail address from outlook format - 334 entries

Create a mail list space separated of mail list formatted by outlook

remove lines containing the word "reader" - 2817 entries

easy stuff

Line under headers - 1387 entries

Put a line under each header, and remove the other markdown formatting.

Quote modules - 615 entries

Complete golang import statement.

Just the middle - 10333 entries

Delete the instructions at the top and bottom.

Bad Copy Syntax - 1588 entries

Copy should be from right to left, but sometimes you type it wrong.

Words in parens - 11995 entries

We should all ace this, right?

Com(m)a Trouble - 2718 entries

Someone was real stupid when placing his commas. Can you fix it?

Aliases for cd - 540 entries

Create these beautiful aliases with as few strokes as possible. Are you up for the challenge?

A HAPPY NEW YEAR 2014 ! - 10081 entries


Hogwarts Email Sorting - 522 entries

Given a list of emails, get the students full name and their associated house.

Applying same text modification in several lines - 2379 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

Vice versa - 6844 entries

Little role switching.

One to Ten - 1711 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread:

Simple text editing with Vim - 11007 entries

Make the pairs of lines match up by making each second line same as first

Swap values inside brackets - 2105 entries

Easy challenge.

SCREAMING_SNAKE_CASE to Title Case - 822 entries

Convert strings in SCREAMING_SNAKE_CASE to Title Case. Examples: EMPLOYEE_NAME -> Employee Name REVENUE_YEAR_TO_DATE -> Revenue Year To Date SALARY -> Salary

Swap values - 4155 entries

Well, swap the values...

Basic renumbering - 5088 entries

Renumbering Basic.

Reorder the groups - 894 entries

Change the order so that the groups of fruit come before the vegetables.

Reconstruct the actual output from my unit test tool report - 85 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.

ninja substitution - 993 entries

How can you reuse a previous substitution ?

Add string initializers to an enum - 607 entries

Change Typescript enum so that it has string initializers.

Collect List - 3881 entries

Convert to comma separated list.

Unsemantic linewrapping - 612 entries

[Inspired by a blog post I read: Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

V to the i - 4338 entries

Input is 99 V's. Output is 100 i's.

Array transposition - 1943 entries

Transpose two arrays into one.

Every other line - 2485 entries


Team names - 1626 entries

The team names are misspelled.

Copy three lines - 2454 entries

If the site is up (by some miracle), make the text under every header identical.

Reformat/Refactor a Golfer Class - 5660 entries

A simple case of removing unneeded code and fixing broken indentation.

C# function to F# - 4 entries

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

switch variable - 4614 entries

how fast can you switch two variable ?

Increment each number - 705 entries

Increment each number individually by one

Put the months in order - 740 entries

Our contractor thought that months should be in alphabetical order. Put them in calendar order please.

Cool or not? - 649 entries

abc trying to be cool or not...

Two pairs of cluster of letters creates word - 621 entries

Clean and group.

-a-b-c- - 2863 entries

Put hyphens everywhere.

html paragraph to table - 547 entries

reformat html paragraph to table

Split line with dots - 2007 entries

This line is too long, split it.

VimGolf Chatter