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]

38277 active golfers, 454176 entries, 580 challenges

Open VimGolf challenges

xrandr outputs and dashes - 671 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

From a Thunderlink to a Markdown link - 757 entries

ThunderLinks are durable hyperlinks to specific email messages generated from Thunderbird in HTML format. Leverage the power of vim to make them suitable for a markdown-formatted file.

Capitalize the Names - 382 entries

I want to capitalize the names in quotes, but just the people's names, not the file names.

Yo To Hello - 1127 entries

Simply Turn Yo To Hello

C# function to F# - 26 entries

Converting from C# to F# is not hard, but requires some manual labor. Here you should convert a C# function using a C# class to a F# function using a C# class.

C# data class to F# record - 69 entries

Converting from C# to F# is not hard, but requires some manual labor. Here you should convert from a C# data class to a F# record.

Replace pattern with 1, 2, 3, ... on each line - 1114 entries

For each line replace a search pattern (in this case $) with numbers starting at 1 and then increasing by 1 for each replaced match. a$b$c$ -> a0b1c2

Alphabet soup - 425 entries

Create a column of all alphabet characters organized in a funky way

Reconstruct the actual output from my unit test tool report - 152 entries

When a test fails, my unit test tool reports differences between the actual output and the expected output as follow: - line in the expected output but missing in the actual output are prefixed with a dash - unexpected lines in the actual output are prefixed with a plus sign - comments added by the unit test tool are prefixed with a question mark - common lines are showed `as-is` (well, almost;) From that "diff" format, I would like to reconstruct the actual output.

Right Align Part of the line - 133 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

Get mail address from outlook format - 642 entries

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

add line and index - 100 entries

a missed line and index names need to be added

prepend * to every non-blank line - 6254 entries

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

Quote modules (ver.2) - 225 entries

Complete golang import statement.

Add text at some column - 162 entries

Complete golang struct statement.

Quote modules - 1066 entries

Complete golang import statement.

Triangle of arrows - 181 entries

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

Aliases for cd - 877 entries

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

Hogwarts Email Sorting - 891 entries

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

Refactor typescript arrow function type - 307 entries

Make arrow function type less verbose and easier to read

Back to the Future - 4 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 - 51 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 - 1203 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 - 2023 entries

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

calculations - 297 entries

Complete these (weird) calculations.

citizen_hacks_2019_part9 - 31 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part6 - 25 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part5 - 26 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part4 - 18 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part3 - 21 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part2 - 22 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part1 - 45 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_challenge6 - 61 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge5 - 139 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge4 - 90 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge3 - 37 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge2 - 194 entries

For the Citizen Hacks 2019 Vim competition.

citizen_hacks_2019_challenge1 - 50 entries

For the Citizen Hacks 2019 Vim competition

Add string initializers to an enum - 866 entries

Change Typescript enum so that it has string initializers.

Extract wireshark capture filter - 203 entries

Extract wireshark capture filter from IP plan

Label grid cells (6x6) - 52 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 - 320 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 - 121 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 - 901 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 - 236 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 - 2009 entries

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

change parenthesis - 287 entries

change the pair of braces into a pair of parentheses

Hash staircase - 53 entries

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

Remove quotes after first field - 367 entries

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

If-then-else regexp - 49 entries

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

VimGolf Chatter