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]

28538 active golfers, 337537 entries, 481 challenges

Open VimGolf challenges

Mess in revision history - 1074 entries

Help Joe clean up what Steve has cobbled.

C Reformatting - 665 entries

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

citizen_hacks_2019_challenge2 - 140 entries

For the Citizen Hacks 2019 Vim competition.

Triangle of arrows - 72 entries

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

Right Align Part of the line - 36 entries

The challenge is to right align a part of the line - this is useful in some SQL queries where it's more clear which are the fields displayed

Count both ways - 918 entries

Right AND down.

Simple format (2) - 256 entries

try again!

Mirror Symmetry - 739 entries

Add backslashes.

remove dupes from array - 1260 entries

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

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

camel riding - 731 entries

add a prefix on some camelCase variables

Hole-in-one - 963 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? - 830 entries

Help me put the newline.

add line and index - 46 entries

a missed line and index names need to be added

Change the content of a string - 1267 entries

This docstring is a complete lie. Fix it.

Condensed Cases - 729 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 - 975 entries

Oops, I spelled that wrong.

Swap the operands under comparison - 240 entries

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

From A to B - 530 entries

Mirror and change this text block

Number Sort - 263 entries

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

The Cake is a Lie - 1166 entries

Correct the capitalization of each word

Gray area - 669 entries

It's a golf metaphor or something.

Sort and add attributes - 1113 entries

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

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

Reformat Cura settings - 102 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

Paragraph breaks - 431 entries

Swap the blank lines and the aaa lines.

Append semicolon after expressions - 898 entries

Some lines need the semicolon, some don't.

Two become one - 692 entries

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

Reconstruct the Sentence - 1038 entries

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

Alsa configuration - 478 entries

I'm tweaking my ~/.asoundrc file!

citizen_hacks_2019_challenge5 - 90 entries

For the Citizen Hacks 2019 Vim competition.

Convert Application Output to CSV - 138 entries

Change the application output to comma-separated values

Todo list specification - 319 entries

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

Array propagate - 264 entries

Complete the array with the keys as part of the value

Resort and deup a CSV list - 125 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 - 929 entries

Make the header text stand out with surrounding asterisks

Exchanging Quotes - 777 entries

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

Ugly spreadsheet copy/paste to CSV - 768 entries

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

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

A Simple One - 854 entries

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

Create a table - 264 entries

Convert the given input into a formatted table

Array Transposition - 160 entries

Transpose four arrays into two.

Flodder-challenge - 819 entries

Replace the text the most efficient and win!

Hello ${world} - 254 entries

Migrate a JavaScript String from concatenation to ES6 interpolation.

Paragraph sort - 337 entries

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

Remember VimGolf Rules ! - 213 entries

Rules, ... and don't forget !

Tables, Functions, Sprocs - 91 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.

Simple addition - 248 entries

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

Python challenge - 124 entries

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

Replace and keep the case - 369 entries

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

VimGolf Chatter