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]

25050 active golfers, 278072 entries, 436 challenges

Open VimGolf challenges

Bad Copy Syntax - 83 entries

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

Add semicolons - 1340 entries

Simply add a semicolon at the end of each line

Box it - 2831 entries

Create a box around a line.

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

change parenthesis - 50 entries

change the pair of braces into a pair of parentheses

simple format - 2779 entries

make it look better.

One number per line - 12689 entries

Just give me the numbers.

Reorder the groups - 355 entries

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

remove lines containing the word "reader" - 1543 entries

easy stuff

I forgot quotes - 11708 entries


Applying same text modification in several lines - 1617 entries

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

Com(m)a Trouble - 1699 entries

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

Just the middle - 9167 entries

Delete the instructions at the top and bottom.

ninja substitution - 493 entries

How can you reuse a previous substitution ?

One to Ten - 903 entries

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

Words in parens - 11011 entries

We should all ace this, right?

A HAPPY NEW YEAR 2014 ! - 9483 entries


Swap values inside brackets - 1449 entries

Easy challenge.

Vice versa - 5903 entries

Little role switching.

html paragraph to table - 343 entries

reformat html paragraph to table

Simple text editing with Vim - 10386 entries

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

Cool or not? - 443 entries

abc trying to be cool or not...

Two pairs of cluster of letters creates word - 390 entries

Clean and group.

Increment each number - 464 entries

Increment each number individually by one

Swap values - 3516 entries

Well, swap the values...

Basic renumbering - 4579 entries

Renumbering Basic.

Join 'em - 113 entries

This shouldn't be too tough

Delete to the end of the current line - 450 entries

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

Collect List - 3467 entries

Convert to comma separated list.

Team names - 1438 entries

The team names are misspelled.

Around the clock - 101 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

Remove quotes after first field - 83 entries

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

Array transposition - 1576 entries

Transpose two arrays into one.

V to the i - 3907 entries

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

Put the months in order - 417 entries

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

Every other line - 2091 entries


convert yml into java pojo field - 639 entries

How fast vim can create fields for java pojo i.e class declaration referring to a (simple) yml file

Change part of a function name in multiple occurrences - 380 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

Copy three lines - 2034 entries

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

Reformat/Refactor a Golfer Class - 5485 entries

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

Split line with dots - 1826 entries

This line is too long, split it.

switch variable - 4302 entries

how fast can you switch two variable ?

move titles next to url, in quotes - 265 entries

had trouble with something similar

multiple cursor alternative - 1062 entries


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

-a-b-c- - 2570 entries

Put hyphens everywhere.

attr_aligner - 2992 entries

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

From argument to object - 1085 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

Search and Replace 0 - 4093 entries

Replace every instance of 'aaa' with 'xaaax'.

Hash staircase - 25 entries

Can you use a strategy to come up with this pattern?

VimGolf Chatter