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]

26185 active golfers, 298103 entries, 459 challenges

Open VimGolf challenges

camel riding - 697 entries

add a prefix on some camelCase variables

citizen_hacks_2019_challenge6 - 28 entries

For the Citizen Hacks 2019 Vim competition.

Hole-in-one - 941 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.

Where should I put the Newline? - 802 entries

Help me put the newline.

Change the content of a string - 1250 entries

This docstring is a complete lie. Fix it.

From A to B - 504 entries

Mirror and change this text block

Condensed Cases - 698 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.

Let's play some Ivmgolf - 937 entries

Oops, I spelled that wrong.

Array propagate - 250 entries

Complete the array with the keys as part of the value

Paragraph breaks - 413 entries

Swap the blank lines and the aaa lines.

Python challenge - 114 entries

Change the types of the variables in the list from str to float, while keeping the truncation.

Gray area - 653 entries

It's a golf metaphor or something.

citizen_hacks_2019_challenge1 - 24 entries

For the Citizen Hacks 2019 Vim competition

The Cake is a Lie - 1139 entries

Correct the capitalization of each word

Todo list specification - 299 entries

The every item on the todo list must be done today. Modify the list to reflect that.

Alsa configuration - 471 entries

I'm tweaking my ~/.asoundrc file!

Sort and add attributes - 1099 entries

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

Ruby 1.9 hashes - 1086 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!

unknown command - 114 entries

I want change 5 words

Two become one - 676 entries

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

Array Transposition - 142 entries

Transpose four arrays into two.

Append semicolon after expressions - 880 entries

Some lines need the semicolon, some don't.

Reconstruct the Sentence - 1028 entries

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

Flip the bit - 84 entries

Change the specific 0 to a 1.

Remember VimGolf Rules ! - 203 entries

Rules, ... and don't forget !

Create a table - 248 entries

Convert the given input into a formatted table

Make Fancy Header - 921 entries

Make the header text stand out with surrounding asterisks

citizen_hacks_2019_challenge3 - 19 entries

For the Citizen Hacks 2019 Vim competition.

Exchanging Quotes - 761 entries

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

Letterbox - 71 entries

Make a box!

Hello ${world} - 232 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

Paragraph sort - 330 entries

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

Simple addition - 234 entries

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

A Simple One - 849 entries

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

Python Hello World! Reformatting - 837 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.

Ugly spreadsheet copy/paste to CSV - 731 entries

convert an ugly spreadsheet copy/paste into a CSV format.

Triangular Numbers - 59 entries

Generate the first 50 triangular numbers.

Flodder-challenge - 814 entries

Replace the text the most efficient and win!

Hash staircase - 34 entries

Can you use a strategy to come up with this pattern?

Nesting SASS - 228 entries

Move a block inside another block and indent it

Stairstep digits - 222 entries

Remove the evens. Double the odds.

Replace and keep the case - 347 entries

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

Wrap text in quotes - 297 entries

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

Mute the second method of this script - 416 entries

prepend a # infront of every line of the second method

If-then-else regexp - 37 entries

Rules: - golf is never following golf - vim comes first! Drawing a finite-state machine diagram could help. #regexp

Combines all items - 244 entries

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

HTML to Haml - 731 entries

Help convert this HTML page to Haml.

Remove noise from HTTP log - 618 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

The name of the game - 587 entries

End up with the name of the game.

Reverse Simple Deletion - 721 entries

You did the simple deletion, now reverse it.

VimGolf Chatter