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]

28134 active golfers, 330676 entries, 477 challenges

Open VimGolf challenges

C Reformatting - 654 entries

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

Mess in revision history - 1035 entries

Help Joe clean up what Steve has cobbled.

Simple format (2) - 255 entries

try again!

Count both ways - 915 entries

Right AND down.

Triangle of arrows - 53 entries

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

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

Mirror Symmetry - 735 entries

Add backslashes.

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 - 727 entries

add a prefix on some camelCase variables

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.

Change the content of a string - 1265 entries

This docstring is a complete lie. Fix it.

Swap the operands under comparison - 238 entries

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

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.

Number Sort - 261 entries

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

Let's play some Ivmgolf - 968 entries

Oops, I spelled that wrong.

From A to B - 524 entries

Mirror and change this text block

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

The Cake is a Lie - 1151 entries

Correct the capitalization of each word

citizen_hacks_2019_challenge5 - 88 entries

For the Citizen Hacks 2019 Vim competition.

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 - 1101 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.

Convert Application Output to CSV - 135 entries

Change the application output to comma-separated values

Two become one - 691 entries

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

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.

Alsa configuration - 475 entries

I'm tweaking my ~/.asoundrc file!

Todo list specification - 318 entries

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

Array propagate - 263 entries

Complete the array with the keys as part of the value

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.

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.

Array Transposition - 159 entries

Transpose four arrays into two.

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

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.

A Simple One - 852 entries

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

Ugly spreadsheet copy/paste to CSV - 747 entries

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

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

Paragraph sort - 336 entries

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

Flodder-challenge - 818 entries

Replace the text the most efficient and win!

Python challenge - 123 entries

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

Remember VimGolf Rules ! - 208 entries

Rules, ... and don't forget !

citizen_hacks_2019_challenge4 - 60 entries

For the Citizen Hacks 2019 Vim competition.

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.

HTML to Haml - 746 entries

Help convert this HTML page to Haml.

unknown command - 118 entries

I want change 5 words

VimGolf Chatter