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]

33976 active golfers, 412487 entries, 544 challenges

Open VimGolf challenges

citizen_hacks_2019_challenge2 - 180 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge1 - 43 entries

For the Citizen Hacks 2019 Vim competition

Add string initializers to an enum - 802 entries

Change Typescript enum so that it has string initializers.

Extract wireshark capture filter - 188 entries

Extract wireshark capture filter from IP plan

Label grid cells (6x6) - 32 entries

Label the cells of a grid with its coordinates. Rows are labelled top to bottom from A to F, and columns left to right from A to F. Each cell has a coordinate MN, where M is the row letter and N is the column letter.

ASCII-art Histogram - 295 entries

Create an ASCCI-art histogram for the given numbers. Make sure not to leave trailing whitespaces. Thanks to VimGolf I recently discovered a feature of Vim thAT blew my mind. I'm curious to see what real ninjas make of it ;-)

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

Unsemantic linewrapping - 846 entries

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

Song Transcription Oops - 227 entries

When transcribing vocal music to Canjo Tab you can start by finding the lowest note and assigning that to zero and working your way up from there. However, without fail, I tend to miscount the notes and when I am near done I find a lower note. I mark this with a "z". This means I have to increase all the previous ones by 1. just a sting of numbers :)

Bad Copy Syntax - 1949 entries

Copy should be from right to left, but sometimes you type it wrong.

change parenthesis - 258 entries

change the pair of braces into a pair of parentheses

Hash staircase - 39 entries

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

Remove quotes after first field - 330 entries

Remove the quotes around each field except for the first field.

If-then-else regexp - 37 entries

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

Tables, Functions, Sprocs - 119 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 Maths 2 - 26 entries

Time to practice expression register! #maths #linear

Rule 110 - 35 entries

Compute the next 5 iterations of Rule 110 with the given starting state. https://en.wikipedia.org/wiki/Rule_110

Join 'em - 233 entries

This shouldn't be too tough

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

Reorder the groups - 1119 entries

Change the order so that the groups of fruit come before the vegetables.

Add semicolons - 10714 entries

Simply add a semicolon at the end of each line

html paragraph to table - 583 entries

reformat html paragraph to table

ninja substitution - 1324 entries

How can you reuse a previous substitution ?

[Real World] PHP To Markdown - 25 entries

Fun refactoring I had to do in the real world. This presents several challenges: - How to create a table that fits the informations exactly - How to keep track of two informations per line while doing the refactoring - Generate the link from the actual text Have fun!

Resort and deup a CSV list - 135 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.

Pascal's Triangle - 34 entries

Generate the first 17 left-justified rows of Pascal's triangle.

Triangular Numbers - 88 entries

Generate the first 50 triangular numbers.

Kolakoski sequence -- level 2 - 10 entries

This time, the line above describes the line below. Level 1 at: http://www.vimgolf.com/challenges/5c880211ab65cb00065c74eb

Convert Application Output to CSV - 180 entries

Change the application output to comma-separated values

Two pairs of cluster of letters creates word - 718 entries

Clean and group.

Kolakoski sequence -- level 1 - 57 entries

Generate the Kolakoski sequence as described by its first 75 terms.

Cool or not? - 765 entries

abc trying to be cool or not...

Letterbox - 88 entries

Make a box!

The D a n k Side of the Moon - 40 entries

You're making a vaporwave cover of The Dark Side of the Moon. So for the tracklisting, you want to: 1. Change the track names to v a p o r c a s e 2. Double the track lengths (since you're slowing them down). Well... let's just double the minutes.

Box it - 7718 entries

Create a box around a line.

Flip the bit - 113 entries

Change the specific 0 to a 1.

snowflake fractal - 39 entries

From step 0 to step 3 of a fractal

Increment each number - 957 entries

Increment each number individually by one

Build a six - 267 entries

Just enjoy building "a" floors...

move titles next to url, in quotes - 496 entries

had trouble with something similar

One to Ten - 2116 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

Delete to the end of the current line - 718 entries

Delete to the end of the current line, but keep the character under the cursor.

Put the months in order - 922 entries

Our contractor thought that months should be in alphabetical order. Put them in calendar order please.

remove lines containing the word "reader" - 3479 entries

easy stuff

Python challenge - 140 entries

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

Change part of a function name in multiple occurrences - 611 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

Santa's naughty / nice list - 77 entries

Christmas is here and Santa hasn't decided who's naughty or nice yet. He's given a list of names to his programmer friend to quickly split the children into naughty and nice. Hint: There's a hidden pattern that might be familiar.

My cafe needs a new menu - 22 entries

Help! My cafe needs a new menu and I've only got this plain-text file from the kitchen. In order to get it printed, I need to transform it into a markdown file with; headings for each type of item, prices on each menu item, dietary options and a key down the bottom.

unknown command - 149 entries

I want change 5 words

simple format (3) - 53 entries

reverse two column values!

VimGolf Chatter