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]

21586 active golfers, 220883 entries, 385 challenges

Open VimGolf challenges

Make it more readable - 1642 entries

Insert blank lines to make it more organized and readable

Fix the XML - 787 entries

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

Do you demand a shrubbery? - 935 entries

Use :redir and crush the emacsgolfers.

Long prime list - filter version - 16 entries

I've used the maximum input/diff/output size allowed by vimgolf to get a list of integers up to 1460 separated by newlines, and your goal is to only keep the lines containing primes. There are 232 of them I hope some of you will golf vimscript itself to create some function to run as a primality check for each line, which is a good exercise if you haven't done much vimscript yet! You're invited to also try copy-pasting and doing other non-smart text manipulation. Even more interesting would be to see a solution that uses text manipulation to do the filtering! Whether you use vimscript, normal-mode primality checks, or text manipulation, as long as the end result is valid, your answer will be valid! Let's see which method does better here. Best of luck!

Numbering a List - 1675 entries

Pretty simple, number the list.

Count both ways - 836 entries

Right AND down.

Mirror Symmetry - 655 entries

Add backslashes.

From A to B - 464 entries

Mirror and change this text block

SFD-ROC: vimvimvim - 1219 entries

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

Mess in revision history - 892 entries

Help Joe clean up what Steve has cobbled.

Paragraph breaks - 373 entries

Swap the blank lines and the aaa lines.

camel riding - 660 entries

add a prefix on some camelCase variables

Shebangs for all - 1532 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.

Simple addition - 201 entries

The right side of the equation is already there. We just need the left one now.

Hello ${world} - 182 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

Create a table - 180 entries

Convert the given input into a formatted table

Where should I put the Newline? - 770 entries

Help me put the newline.

Hole-in-one - 922 entries

Lets take this golf thing literally.. Drive off the tee into the hole, and of course you don't strike the ball completely clean.

Subnetting - 50 entries

Split up the IP addresses in the right way.

Alsa configuration - 434 entries

I'm tweaking my ~/.asoundrc file!

Condensed Cases - 648 entries

Apple's new programming language, Swift, allows two style of case statements: 1) one Enum case on each line, or 2) multiple Enum cases on a single line. Convert the following from the first case (no pun intended) to the second type.

Stairstep digits - 190 entries

Remove the evens. Double the odds.

remove dupes from array - 1148 entries

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

Nesting SASS - 184 entries

Move a block inside another block and indent it

Interactive git rebase changing commands - 131 entries

How to change the action of some commits in git rebase dialog.

Gray area - 597 entries

It's a golf metaphor or something.

Change the content of a string - 1191 entries

This docstring is a complete lie. Fix it.

Combines all items - 219 entries

For each line that starts with the same number I want to combine its contents

Let's play some Ivmgolf - 853 entries

Oops, I spelled that wrong.

Paragraph sort - 287 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

Two become one - 626 entries

We have two c arrays and want to make one two dimensional out of it. Can we do that?

The Cake is a Lie - 1096 entries

Correct the capitalization of each word

Sort and add attributes - 1034 entries

Sort the states and add the attribute country to each record.

Ruby 1.9 hashes - 1022 entries

Rubyists talk about being cutting edge but how many are using 1.9 in production? Time to convert those verbose 1.8 hashes in to symbolic, succinct 1.9 beauties!

Append semicolon after expressions - 810 entries

Some lines need the semicolon, some don't.

Wrap text in quotes - 261 entries

All the blocks of text should be wrapped in quotation marks.

Reconstruct the Sentence - 982 entries

Get the sentence back in the proper order, remove duplicate lines, and then combine the separate lines into one.

Add Go XML to structure tags - 122 entries

The Go programming language can directly map XML to structure fields. Add the correct XML tag after each field.

Replace and keep the case - 317 entries

Replace all instance of plugin and Plugin to device and Device.

Separate the lines - 116 entries

Every other line is mixed up. Separate them into their original texts.

Text to HTML Table - 118 entries

Turn the plain text table to an HTML table.

Exchanging Quotes - 722 entries

Sometimes you need to exchange a choice of quotes in some code.

Make Fancy Header - 866 entries

Make the header text stand out with surrounding asterisks

Mute the second method of this script - 384 entries

prepend a # infront of every line of the second method

replace 2nd column blanks with values in same column if blank - 171 entries

Where ,SOMELOGB and ,SOMELOGC replaces each /r carriage return if 2nd column is blank. The replace only happens if 2nd column is blank though and should replace up to the non blank row.

Generate a list of numbers - 212 entries

Please generate list of numbers from 1 to 20.

Un"finnish"ed Work - 94 entries

Replace å by a, ä by a and ö by o.

A Simple One - 794 entries

Here is a very simple one - just to illustrate/introduce a vim feature that some people seem to miss...

Python Hello World! Reformatting - 792 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

Flodder-challenge - 784 entries

Replace the text the most efficient and win!

VimGolf Chatter