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]

27458 active golfers, 320771 entries, 470 challenges

Open VimGolf challenges

Get mail address from outlook format - 8 entries

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

prepend * to every non-blank line - 1215 entries

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

Add semicolons - 6812 entries

Simply add a semicolon at the end of each line

Simple, Practical, and Common - 28913 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 - 5504 entries

Create a box around a line.

One number per line - 15624 entries

Just give me the numbers.

Quote modules - 452 entries

Complete golang import statement.

I forgot quotes - 13768 entries


Aliases for cd - 428 entries

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

Line under headers - 1230 entries

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

Bad Copy Syntax - 1498 entries

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

remove lines containing the word "reader" - 2605 entries

easy stuff

Just the middle - 10111 entries

Delete the instructions at the top and bottom.

Hogwarts Email Sorting - 369 entries

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

Words in parens - 11806 entries

We should all ace this, right?

Com(m)a Trouble - 2549 entries

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

A HAPPY NEW YEAR 2014 ! - 9976 entries


Applying same text modification in several lines - 2301 entries

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

Vice versa - 6685 entries

Little role switching.

One to Ten - 1643 entries

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

SCREAMING_SNAKE_CASE to Title Case - 765 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 inside brackets - 2044 entries

Easy challenge.

Simple text editing with Vim - 10898 entries

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

Reorder the groups - 871 entries

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

ninja substitution - 959 entries

How can you reuse a previous substitution ?

Swap values - 4024 entries

Well, swap the values...

Add string initializers to an enum - 575 entries

Change Typescript enum so that it has string initializers.

Basic renumbering - 5022 entries

Renumbering Basic.

Unsemantic linewrapping - 567 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:

Collect List - 3793 entries

Convert to comma separated list.

V to the i - 4255 entries

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

Array transposition - 1852 entries

Transpose two arrays into one.

Every other line - 2393 entries


Team names - 1598 entries

The team names are misspelled.

Copy three lines - 2371 entries

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

Reformat/Refactor a Golfer Class - 5628 entries

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

Increment each number - 664 entries

Increment each number individually by one

Add text at some column - 96 entries

Complete golang struct statement.

Cool or not? - 615 entries

abc trying to be cool or not...

Put the months in order - 706 entries

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

Two pairs of cluster of letters creates word - 584 entries

Clean and group.

Quote modules (ver.2) - 92 entries

Complete golang import statement.

switch variable - 4543 entries

how fast can you switch two variable ?

html paragraph to table - 496 entries

reformat html paragraph to table

Split line with dots - 1984 entries

This line is too long, split it.

-a-b-c- - 2813 entries

Put hyphens everywhere.

Delete to the end of the current line - 620 entries

Delete to the end of the current line, but keep the character under the cursor.

multiple cursor alternative - 1296 entries


add line and index - 44 entries

a missed line and index names need to be added

attr_aligner - 3196 entries

Two attr keywords. Two separate indentations. Align the colons.

VimGolf Chatter