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]

25860 active golfers, 291769 entries, 459 challenges

Open VimGolf challenges

Add semicolons - 3480 entries

Simply add a semicolon at the end of each line

Simple, Practical, and Common - 26160 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 - 3836 entries

Create a box around a line.

Line under headers - 376 entries

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

One number per line - 13715 entries

Just give me the numbers.

Bad Copy Syntax - 793 entries

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

I forgot quotes - 12364 entries


remove lines containing the word "reader" - 1989 entries

easy stuff

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

Add string initializers to an enum - 233 entries

Change Typescript enum so that it has string initializers.

Just the middle - 9529 entries

Delete the instructions at the top and bottom.

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

Applying same text modification in several lines - 1842 entries

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

Com(m)a Trouble - 1935 entries

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

Words in parens - 11260 entries

We should all ace this, right?

A HAPPY NEW YEAR 2014 ! - 9653 entries


One to Ten - 1161 entries

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

Reorder the groups - 557 entries

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

Vice versa - 6132 entries

Little role switching.

Swap values inside brackets - 1685 entries

Easy challenge.

ninja substitution - 692 entries

How can you reuse a previous substitution ?

Simple text editing with Vim - 10592 entries

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

calculations - 107 entries

Complete these (weird) calculations.

ASCII-art Histogram - 158 entries

Create an ASCCI-art histogram for the given numbers. Make sure not to leave trailing whitespaces. Thanks to VimGolf I recently discovered a feature of Vim thAT blew my mind. I'm curious to see what real ninjas make of it ;-)

citizen_hacks_2019_challenge2 - 106 entries

For the Citizen Hacks 2019 Vim competition.

Swap values - 3672 entries

Well, swap the values...

Extract wireshark capture filter - 120 entries

Extract wireshark capture filter from IP plan

Basic renumbering - 4756 entries

Renumbering Basic.

html paragraph to table - 436 entries

reformat html paragraph to table

Cool or not? - 536 entries

abc trying to be cool or not...

Two pairs of cluster of letters creates word - 477 entries

Clean and group.

Collect List - 3575 entries

Convert to comma separated list.

Increment each number - 555 entries

Increment each number individually by one

Team names - 1498 entries

The team names are misspelled.

V to the i - 4054 entries

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

Array transposition - 1704 entries

Transpose two arrays into one.

Every other line - 2197 entries


Put the months in order - 552 entries

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

change parenthesis - 172 entries

change the pair of braces into a pair of parentheses

Delete to the end of the current line - 522 entries

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

Copy three lines - 2208 entries

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

Song Transcription Oops - 134 entries

When transcribing vocal music to Canjo Tab you can start by finding the lowest note and assigning that to zero and working your way up from there. However, without fail, I tend to miscount the notes and when I am near done I find a lower note. I mark this with a "z". This means I have to increase all the previous ones by 1. just a sting of numbers :)

Reformat/Refactor a Golfer Class - 5551 entries

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

citizen_hacks_2019_challenge5 - 61 entries

For the Citizen Hacks 2019 Vim competition.

convert yml into java pojo field - 687 entries

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

Reformat Cura settings - 93 entries

Cura settings are weirdly encoded... After mere replacements, you'll have to enquote two strings (infill_pattern & speed_travel) and dont forget booleans in lowercase. #format #json

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

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

switch variable - 4382 entries

how fast can you switch two variable ?

Split line with dots - 1894 entries

This line is too long, split it.

multiple cursor alternative - 1143 entries


VimGolf Chatter