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]

25093 active golfers, 278573 entries, 436 challenges

Open VimGolf challenges

Bad Copy Syntax - 168 entries

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

Add semicolons - 1422 entries

Simply add a semicolon at the end of each line

Box it - 2882 entries

Create a box around a line.

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

simple format - 2817 entries

make it look better.

One number per line - 12718 entries

Just give me the numbers.

change parenthesis - 60 entries

change the pair of braces into a pair of parentheses

Reorder the groups - 355 entries

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

remove lines containing the word "reader" - 1549 entries

easy stuff

I forgot quotes - 11726 entries


Applying same text modification in several lines - 1626 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 - 9169 entries

Delete the instructions at the top and bottom.

ninja substitution - 499 entries

How can you reuse a previous substitution ?

One to Ten - 911 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 ! - 9487 entries


Swap values inside brackets - 1449 entries

Easy challenge.

Vice versa - 5908 entries

Little role switching.

html paragraph to table - 343 entries

reformat html paragraph to table

Simple text editing with Vim - 10388 entries

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

Cool or not? - 449 entries

abc trying to be cool or not...

Two pairs of cluster of letters creates word - 391 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 - 114 entries

This shouldn't be too tough

Collect List - 3467 entries

Convert to comma separated list.

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.

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

Array transposition - 1591 entries

Transpose two arrays into one.

V to the i - 3909 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.

Remove quotes after first field - 83 entries

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

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


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

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.

Search and Replace 0 - 4096 entries

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

quotes inside quotes - 2778 entries

taken from tip 85 of the very good book 'Practical Vim: Edit Text at the Speed of Thought' ! I'd be interested what people use :)

VimGolf Chatter