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]

30140 active golfers, 368117 entries, 507 challenges

Open VimGolf challenges

Rural Post - 3457 entries

Simple challenge to remove all but the post code on each line

Add semicolons - 10161 entries

Simply add a semicolon at the end of each line

prepend * to every non-blank line - 5635 entries

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

Simple, Practical, and Common - 32563 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.

swap number pairs - 955 entries

Swap the numbers in a bunch of 2-element arrays.

Box it - 7553 entries

Create a box around a line.

One number per line - 18132 entries

Just give me the numbers.

Satisfy the go linter - 1460 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

I forgot quotes - 15593 entries


Modernise code - 233 entries

Modernise and clean up some C++ code.

Just the middle - 11061 entries

Delete the instructions at the top and bottom.

Words in parens - 12655 entries

We should all ace this, right?

remove lines containing the word "reader" - 3399 entries

easy stuff

A HAPPY NEW YEAR 2014 ! - 10496 entries


HS Final exam vimgolf - 305 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

Com(m)a Trouble - 3253 entries

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

Line under headers - 1832 entries

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

Vice versa - 7369 entries

Little role switching.

Yo To Hello - 818 entries

Simply Turn Yo To Hello

Replace pattern with 1, 2, 3, ... on each line - 866 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

Bad Copy Syntax - 1879 entries

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

Applying same text modification in several lines - 2689 entries

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

Simple text editing with Vim - 11306 entries

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

One to Ten - 2027 entries

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

Quote modules - 969 entries

Complete golang import statement.

Swap values inside brackets - 2395 entries

Easy challenge.

From a Thunderlink to a Markdown link - 570 entries

ThunderLinks are durable hyperlinks to specific email messages generated from Thunderbird in HTML format. Leverage the power of vim to make them suitable for a markdown-formatted file.

Swap values - 4373 entries

Well, swap the values...

Basic renumbering - 5389 entries

Renumbering Basic.

RUST match with enum for Coin - 75 entries

RUST match with enum for Coin rusty practice on vimgolf

SCREAMING_SNAKE_CASE to Title Case - 1059 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

Aliases for cd - 758 entries

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

Hogwarts Email Sorting - 759 entries

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

Collect List - 4132 entries

Convert to comma separated list.

xrandr outputs and dashes - 436 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

V to the i - 4577 entries

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

RUST Cargo.toml version to last - 57 entries

RUST Cargo.toml version to last. rusty practice on vimgolf

ninja substitution - 1193 entries

How can you reuse a previous substitution ?

Add quotes to ansible playbook - 343 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

Reorder the groups - 1046 entries

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

Every other line - 2770 entries


Array transposition - 2233 entries

Transpose two arrays into one.

Get mail address from outlook format - 486 entries

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

Copy three lines - 2743 entries

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

Reformat/Refactor a Golfer Class - 5779 entries

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

Team names - 1751 entries

The team names are misspelled.

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

switch variable - 4856 entries

how fast can you switch two variable ?

Add string initializers to an enum - 724 entries

Change Typescript enum so that it has string initializers.

-a-b-c- - 3076 entries

Put hyphens everywhere.

VimGolf Chatter