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]

25404 active golfers, 282555 entries, 439 challenges

Open VimGolf challenges

Add semicolons - 2276 entries

Simply add a semicolon at the end of each line

Box it - 3298 entries

Create a box around a line.

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

ASCII-art Histogram - 76 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 ;-)

Bad Copy Syntax - 541 entries

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

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

One number per line - 13102 entries

Just give me the numbers.

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

remove lines containing the word "reader" - 1754 entries

easy stuff

I forgot quotes - 11998 entries

Oops.

Reorder the groups - 486 entries

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

Just the middle - 9346 entries

Delete the instructions at the top and bottom.

Applying same text modification in several lines - 1723 entries

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

Com(m)a Trouble - 1805 entries

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

ninja substitution - 629 entries

How can you reuse a previous substitution ?

Words in parens - 11120 entries

We should all ace this, right?

One to Ten - 1022 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 ! - 9560 entries

A HAPPY NEW YEAR 2014 !

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

Swap values inside brackets - 1533 entries

Easy challenge.

Vice versa - 6001 entries

Little role switching.

change parenthesis - 143 entries

change the pair of braces into a pair of parentheses

html paragraph to table - 413 entries

reformat html paragraph to table

Simple text editing with Vim - 10474 entries

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

Cool or not? - 496 entries

abc trying to be cool or not...

Swap values - 3589 entries

Well, swap the values...

Two pairs of cluster of letters creates word - 437 entries

Clean and group.

Basic renumbering - 4651 entries

Renumbering Basic.

Increment each number - 509 entries

Increment each number individually by one

Collect List - 3536 entries

Convert to comma separated list.

Team names - 1477 entries

The team names are misspelled.

V to the i - 3954 entries

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

Array transposition - 1638 entries

Transpose two arrays into one.

Delete to the end of the current line - 478 entries

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

Put the months in order - 477 entries

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

Every other line - 2125 entries

AaAaAaA

Join 'em - 146 entries

This shouldn't be too tough

Copy three lines - 2095 entries

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

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

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

Remove quotes after first field - 131 entries

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

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

Reformat/Refactor a Golfer Class - 5518 entries

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

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

switch variable - 4325 entries

how fast can you switch two variable ?

Split line with dots - 1843 entries

This line is too long, split it.

move titles next to url, in quotes - 313 entries

had trouble with something similar

multiple cursor alternative - 1083 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

-a-b-c- - 2617 entries

Put hyphens everywhere.

attr_aligner - 3025 entries

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

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

VimGolf Chatter