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]

25598 active golfers, 286128 entries, 456 challenges

Open VimGolf challenges

Add semicolons - 2755 entries

Simply add a semicolon at the end of each line

Box it - 3508 entries

Create a box around a line.

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

Add string initializers to an enum - 136 entries

Change Typescript enum so that it has string initializers.

calculations - 61 entries

Complete these (weird) calculations.

Bad Copy Syntax - 652 entries

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

One number per line - 13373 entries

Just give me the numbers.

citizen_hacks_2019_challenge2 - 78 entries

For the Citizen Hacks 2019 Vim competition.

Unsemantic linewrapping - 316 entries

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. 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:

remove lines containing the word "reader" - 1863 entries

easy stuff

I forgot quotes - 12148 entries

Oops.

Extract wireshark capture filter - 97 entries

Extract wireshark capture filter from IP plan

ASCII-art Histogram - 145 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_challenge5 - 44 entries

For the Citizen Hacks 2019 Vim competition.

Just the middle - 9421 entries

Delete the instructions at the top and bottom.

Reorder the groups - 543 entries

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

Applying same text modification in several lines - 1778 entries

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

Com(m)a Trouble - 1847 entries

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

Words in parens - 11168 entries

We should all ace this, right?

One to Ten - 1086 entries

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

A HAPPY NEW YEAR 2014 ! - 9594 entries

A HAPPY NEW YEAR 2014 !

ninja substitution - 656 entries

How can you reuse a previous substitution ?

Swap values inside brackets - 1620 entries

Easy challenge.

Vice versa - 6064 entries

Little role switching.

citizen_hacks_2019_challenge4 - 32 entries

For the Citizen Hacks 2019 Vim competition.

Simple text editing with Vim - 10528 entries

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

Reformat Cura settings - 86 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

citizen_hacks_2019_challenge6 - 24 entries

For the Citizen Hacks 2019 Vim competition.

html paragraph to table - 420 entries

reformat html paragraph to table

Swap values - 3617 entries

Well, swap the values...

Song Transcription Oops - 120 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 :)

Cool or not? - 506 entries

abc trying to be cool or not...

Basic renumbering - 4682 entries

Renumbering Basic.

change parenthesis - 153 entries

change the pair of braces into a pair of parentheses

citizen_hacks_2019_challenge1 - 20 entries

For the Citizen Hacks 2019 Vim competition

Increment each number - 531 entries

Increment each number individually by one

Two pairs of cluster of letters creates word - 440 entries

Clean and group.

Collect List - 3544 entries

Convert to comma separated list.

Team names - 1482 entries

The team names are misspelled.

V to the i - 3973 entries

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

Array transposition - 1647 entries

Transpose two arrays into one.

Put the months in order - 499 entries

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

Delete to the end of the current line - 482 entries

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

Every other line - 2128 entries

AaAaAaA

citizen_hacks_2019_challenge3 - 15 entries

For the Citizen Hacks 2019 Vim competition.

Copy three lines - 2128 entries

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

Reformat/Refactor a Golfer Class - 5524 entries

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

convert yml into java pojo field - 669 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 - 434 entries

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

Join 'em - 157 entries

This shouldn't be too tough

VimGolf Chatter