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]

27402 active golfers, 319976 entries, 469 challenges

Open VimGolf challenges

Search and Replace 0 - 4388 entries

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

convert yml into java pojo field - 758 entries

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

quotes inside quotes - 2909 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 :)

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

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

That hyphen - 2319 entries

"vim vi improved"

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

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

Extract argument from function - 2106 entries

The aim is to see if you can do some refactoring very fast.

move titles next to url, in quotes - 394 entries

had trouble with something similar

replacing each line of a block selection - 2667 entries

replace each line's ../assets/js with /javascripts

Don't know what this is - 1847 entries

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

comment and uncomment code inline - 918 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

calculations - 175 entries

Complete these (weird) calculations.

Adam's challenge - 866 entries

Change both normal to bold and 4 by 2. Adam Wathan challenge this on twitter . He did it in 11 keystrokes on Sublime.

change parenthesis - 213 entries

change the pair of braces into a pair of parentheses

Whitespace, empty lines and tabs - 2688 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

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

Vertical Limit - 2211 entries

transform a succession of one word lines to a an array of strings

Space out the alphabet - 1449 entries

Put 3 spaces between adjacent letters.

Missing Library and a Typo - 777 entries

I forgot to add a c library, please add it for me. Also I'm bad at typing so fix my typo too.

Remove quotes after first field - 212 entries

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

Saving the hashes(#) - 1854 entries

The following file is copied from only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

Extract wireshark capture filter - 150 entries

Extract wireshark capture filter from IP plan

Fiddle percentages into real numbers - 756 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

Triangle of arrows - 41 entries

I made this by accident when working on another challenge. How would you go about making this?

citizen_hacks_2019_challenge2 - 139 entries

For the Citizen Hacks 2019 Vim competition.

Switch function arguments - 1872 entries

How to switch two arguments of a function.

Preferably without multi-cursor plugin - 363 entries

Originally asked as question on reddit by kpthunder:

Order and join - 796 entries

There's something special about the input order.

Align commas - 928 entries

There are 15,000 aligning challenges on, and they're all exactly the same. I hope this one is a little different.

Join 'em - 191 entries

This shouldn't be too tough

Letter case trickery - 1461 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

Build a six - 251 entries

Just enjoy building "a" floors...

Make it more readable - 1785 entries

Insert blank lines to make it more organized and readable

comments galore - 913 entries

Basic comment reformatting

Learn some german verbs - 415 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

Make HTML List - 917 entries

Turn the comma separated list into an unordered html list.

Numbering a List - 1756 entries

Pretty simple, number the list.

Scrambled numbers - 753 entries

Four is NOT 1. One is 1.

Simple format (2) - 255 entries

try again!

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

Do you demand a shrubbery? - 1035 entries

Use :redir and crush the emacsgolfers.

C Reformatting - 654 entries

You may use Visual mode... or not. #uppercase

Fix the XML - 896 entries

The challenge consists in having a valid xml from an incomplete source.

Shebangs for all - 1643 entries

We've all seen or used a shebang once or twice. Ditch the specific paths and leave just a dynamic Ruby and Python bath behind.

SFD-ROC: vimvimvim - 1337 entries

Oh no, this line is longer than 80 chars... put each 'vim' on a new line.

Mess in revision history - 1018 entries

Help Joe clean up what Steve has cobbled.

Count both ways - 905 entries

Right AND down.

Reformat Cura settings - 99 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_challenge5 - 88 entries

For the Citizen Hacks 2019 Vim competition.

VimGolf Chatter