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]

26686 active golfers, 307423 entries, 461 challenges

Open VimGolf challenges

Add semicolons - 5500 entries

Simply add a semicolon at the end of each line

Simple, Practical, and Common - 27699 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 - 4798 entries

Create a box around a line.

One number per line - 14779 entries

Just give me the numbers.

Line under headers - 930 entries

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

Bad Copy Syntax - 1298 entries

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

I forgot quotes - 13081 entries

Oops.

remove lines containing the word "reader" - 2368 entries

easy stuff

Just the middle - 9856 entries

Delete the instructions at the top and bottom.

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

Words in parens - 11558 entries

We should all ace this, right?

Com(m)a Trouble - 2302 entries

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

Applying same text modification in several lines - 2107 entries

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

A HAPPY NEW YEAR 2014 ! - 9837 entries

A HAPPY NEW YEAR 2014 !

One to Ten - 1459 entries

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

Vice versa - 6422 entries

Little role switching.

Add string initializers to an enum - 493 entries

Change Typescript enum so that it has string initializers.

Swap values inside brackets - 1886 entries

Easy challenge.

Reorder the groups - 796 entries

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

Simple text editing with Vim - 10748 entries

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

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

ninja substitution - 825 entries

How can you reuse a previous substitution ?

Swap values - 3847 entries

Well, swap the values...

Refactor typescript arrow function type - 148 entries

Make arrow function type less verbose and easier to read

Basic renumbering - 4888 entries

Renumbering Basic.

Collect List - 3670 entries

Convert to comma separated list.

V to the i - 4188 entries

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

Team names - 1568 entries

The team names are misspelled.

Array transposition - 1797 entries

Transpose two arrays into one.

Every other line - 2299 entries

AaAaAaA

Increment each number - 636 entries

Increment each number individually by one

Cool or not? - 577 entries

abc trying to be cool or not...

Two pairs of cluster of letters creates word - 553 entries

Clean and group.

html paragraph to table - 473 entries

reformat html paragraph to table

Copy three lines - 2299 entries

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

Reformat/Refactor a Golfer Class - 5578 entries

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

Put the months in order - 623 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 - 578 entries

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

switch variable - 4470 entries

how fast can you switch two variable ?

Split line with dots - 1935 entries

This line is too long, split it.

multiple cursor alternative - 1233 entries

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

-a-b-c- - 2760 entries

Put hyphens everywhere.

convert yml into java pojo field - 732 entries

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

attr_aligner - 3106 entries

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

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

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

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

calculations - 166 entries

Complete these (weird) calculations.

Search and Replace 0 - 4264 entries

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

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

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