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]

31055 active golfers, 375709 entries, 520 challenges

Open VimGolf challenges

Get mail address from outlook format - 525 entries

Create a mail list space separated of mail list formatted by outlook

add line and index - 51 entries

a missed line and index names need to be added

prepend * to every non-blank line - 5776 entries

Prepend an asterisk to every non-blank line in the input file.

Quote modules (ver.2) - 175 entries

Complete golang import statement.

Add text at some column - 134 entries

Complete golang struct statement.

Quote modules - 981 entries

Complete golang import statement.

Triangle of arrows - 102 entries

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

Aliases for cd - 781 entries

Create these beautiful aliases with as few strokes as possible. Are you up for the challenge?

Hogwarts Email Sorting - 783 entries

Given a list of emails, get the students full name and their associated house.

Refactor typescript arrow function type - 272 entries

Make arrow function type less verbose and easier to read

Back to the Future - 3 entries

We can't just time-travel around without first making sure our code is pretty and columns are aligned. And keeping lines with at most 80 characters should help if we ever need to review the code while we're stuck in the past. This is my first challenge. I tried being creative and even did a bit of research, so I hope you enjoy it.

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.

SCREAMING_SNAKE_CASE to Title Case - 1064 entries

Convert strings in SCREAMING_SNAKE_CASE to Title Case. Examples: EMPLOYEE_NAME -> Employee Name REVENUE_YEAR_TO_DATE -> Revenue Year To Date SALARY -> Salary

Line under headers - 1852 entries

Put a line under each header, and remove the other markdown formatting.

calculations - 244 entries

Complete these (weird) calculations.

citizen_hacks_2019_part9 - 9 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part6 - 14 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part5 - 13 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part4 - 7 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part3 - 14 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part2 - 8 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part1 - 15 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_challenge6 - 42 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge5 - 106 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge4 - 65 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge3 - 23 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge2 - 156 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge1 - 29 entries

For the Citizen Hacks 2019 Vim competition

Add string initializers to an enum - 726 entries

Change Typescript enum so that it has string initializers.

Extract wireshark capture filter - 168 entries

Extract wireshark capture filter from IP plan

Label grid cells (6x6) - 19 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 - 269 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 - 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

Unsemantic linewrapping - 806 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 - 218 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 - 1882 entries

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

change parenthesis - 235 entries

change the pair of braces into a pair of parentheses

Hash staircase - 38 entries

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

Remove quotes after first field - 311 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 - 106 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 - 19 entries

Time to practice expression register! #maths #linear

Rule 110 - 33 entries

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

Join 'em - 211 entries

This shouldn't be too tough

Around the clock - 167 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 - 1071 entries

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

Add semicolons - 10429 entries

Simply add a semicolon at the end of each line

html paragraph to table - 583 entries

reformat html paragraph to table

ninja substitution - 1238 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!

VimGolf Chatter