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]

27419 active golfers, 320226 entries, 469 challenges

Open VimGolf challenges

citizen_hacks_2019_challenge5 - 88 entries

For the Citizen Hacks 2019 Vim competition.

remove dupes from array - 1257 entries

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

camel riding - 724 entries

add a prefix on some camelCase variables

Swap the operands under comparison - 238 entries

Swap the operands under comparison to prevent null pointer exception (at least in java)

Hole-in-one - 958 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? - 824 entries

Help me put the newline.

Number Sort - 261 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

Change the content of a string - 1260 entries

This docstring is a complete lie. Fix it.

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

From A to B - 524 entries

Mirror and change this text block

Let's play some Ivmgolf - 967 entries

Oops, I spelled that wrong.

Convert Application Output to CSV - 135 entries

Change the application output to comma-separated values

The Cake is a Lie - 1148 entries

Correct the capitalization of each word

Resort and deup a CSV list - 122 entries

I'm always adding items to a sorted list. There has to be a better way dedup and resort the lists. There are multiple lists with varying lengths to discourage manual sorting. Also Australia's animals are weird.

Gray area - 664 entries

It's a golf metaphor or something.

Sort and add attributes - 1110 entries

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

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

Paragraph breaks - 424 entries

Swap the blank lines and the aaa lines.

Two become one - 691 entries

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

Array propagate - 263 entries

Complete the array with the keys as part of the value

Todo list specification - 313 entries

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

Alsa configuration - 475 entries

I'm tweaking my ~/.asoundrc file!

Append semicolon after expressions - 892 entries

Some lines need the semicolon, some don't.

Reconstruct the Sentence - 1034 entries

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

Tables, Functions, Sprocs - 88 entries

In order to load some scripts into my database in the correct order I need to load tables first (t_), then functions (fn_), then stored procedures (sp_). The order of the t_ lines and the order of the sp_ lines should also match. Reorder the lines so they will load correctly.

Comparing Schema With Diff - 50 entries

Sometimes databases output things differently one to another. Fixing things that are out of order will make the diffs more usable.

citizen_hacks_2019_challenge4 - 59 entries

For the Citizen Hacks 2019 Vim competition.

Array Transposition - 159 entries

Transpose four arrays into two.

Make Fancy Header - 928 entries

Make the header text stand out with surrounding asterisks

Exchanging Quotes - 776 entries

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

Python challenge - 123 entries

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

Hello ${world} - 253 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

Create a table - 253 entries

Convert the given input into a formatted table

Remember VimGolf Rules ! - 208 entries

Rules, ... and don't forget !

A Simple One - 852 entries

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

Python Hello World! Reformatting - 852 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 - 747 entries

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

Paragraph sort - 336 entries

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

unknown command - 118 entries

I want change 5 words

Flodder-challenge - 818 entries

Replace the text the most efficient and win!

Simple addition - 239 entries

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

Replace and keep the case - 363 entries

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

Wrap text in quotes - 306 entries

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

Mute the second method of this script - 418 entries

prepend a # infront of every line of the second method

HTML to Haml - 746 entries

Help convert this HTML page to Haml.

Nesting SASS - 235 entries

Move a block inside another block and indent it

Remove noise from HTTP log - 622 entries

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

Stairstep digits - 225 entries

Remove the evens. Double the odds.

Reverse Simple Deletion - 730 entries

You did the simple deletion, now reverse it.

The name of the game - 594 entries

End up with the name of the game.

VimGolf Chatter