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]

24804 active golfers, 274679 entries, 433 challenges

Open VimGolf challenges

Add semicolons - 830 entries

Simply add a semicolon at the end of each line

Box it - 2449 entries

Create a box around a line.

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

Reorder the groups - 255 entries

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

simple format - 2612 entries

make it look better.

One number per line - 12477 entries

Just give me the numbers.

remove lines containing the word "reader" - 1457 entries

easy stuff

I forgot quotes - 11591 entries


ninja substitution - 428 entries

How can you reuse a previous substitution ?

Applying same text modification in several lines - 1561 entries

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

Com(m)a Trouble - 1627 entries

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

One to Ten - 854 entries

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

Just the middle - 9091 entries

Delete the instructions at the top and bottom.

html paragraph to table - 330 entries

reformat html paragraph to table

Words in parens - 10940 entries

We should all ace this, right?

Join 'em - 98 entries

This shouldn't be too tough

Remove quotes after first field - 67 entries

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

A HAPPY NEW YEAR 2014 ! - 9440 entries


Swap values inside brackets - 1415 entries

Easy challenge.

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

Vice versa - 5884 entries

Little role switching.

Two pairs of cluster of letters creates word - 386 entries

Clean and group.

Cool or not? - 422 entries

abc trying to be cool or not...

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

Simple text editing with Vim - 10354 entries

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

Increment each number - 445 entries

Increment each number individually by one

Swap values - 3483 entries

Well, swap the values...

Basic renumbering - 4571 entries

Renumbering Basic.

Delete to the end of the current line - 423 entries

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

Team names - 1422 entries

The team names are misspelled.

Collect List - 3443 entries

Convert to comma separated list.

If-then-else regexp - 34 entries

Rules: - golf is never following golf - vim comes first! Drawing a finite-state machine diagram could help. #regexp

Put the months in order - 403 entries

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

Array transposition - 1572 entries

Transpose two arrays into one.

V to the i - 3874 entries

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

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

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

Every other line - 2076 entries


convert yml into java pojo field - 637 entries

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

Copy three lines - 2002 entries

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

move titles next to url, in quotes - 265 entries

had trouble with something similar

Reformat/Refactor a Golfer Class - 5470 entries

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

Split line with dots - 1802 entries

This line is too long, split it.

multiple cursor alternative - 1052 entries


switch variable - 4286 entries

how fast can you switch two variable ?

-a-b-c- - 2551 entries

Put hyphens everywhere.

From argument to object - 1073 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?

attr_aligner - 2968 entries

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

Build a six - 193 entries

Just enjoy building "a" floors...

Search and Replace 0 - 4066 entries

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

quotes inside quotes - 2757 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