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]

Played Challenges

Lowercase first characters - 149 entries

This is the (abridged) input for Day 3 in Advent of Code 2019. The output is a format more suitable for Prolog programming: the two lines of input become two lists of pairs, joined together in a wires functor.

  • Best score: 33
  • Best player score: 36
  • Position: #22 / 53
  • Number of attempts: 1
simple replacements - 556 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #28 / 130
  • Number of attempts: 1
Inverting Lines - 855 entries

A simple challenge to invert all lines, except the first.

  • Best score: 10
  • Best player score: 10
  • Position: #23 / 237
  • Number of attempts: 1
Making 3 line function a one liner. - 65 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #4 / 52
  • Number of attempts: 1
Modernise code - 596 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #7 / 139
  • Number of attempts: 2
HS Final exam vimgolf - 540 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 22
  • Position: #21 / 148
  • Number of attempts: 2
Extend shell script - 62 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 46
  • Position: #13 / 23
  • Number of attempts: 1
Easy modification of ssh config - 147 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 26
  • Position: #22 / 45
  • Number of attempts: 1
ssh config skills - 149 entries

Parse output from `kuebctl get no -o wide` into an .ssh/config file!

  • Best score: 41
  • Best player score: 55
  • Position: #18 / 38
  • Number of attempts: 1
Mr. Hacker - 33 entries

Elvin is hacker. He has piece of users database from some social net site. Recently he installed Vim, and he wants to convert CSV DB to specific format `key=value' where `key' is login and `value' is password, but password in DB is encrypted in ROT13. Help him.

  • Best score: 19
  • Best player score: 19
  • Position: #7 / 16
  • Number of attempts: 2
Python: Def to Lambda - 196 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 19
  • Position: #25 / 69
  • Number of attempts: 1
Turn the x - 151 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 21
  • Position: #24 / 43
  • Number of attempts: 1
Format the CSS - 47 entries

You just copied some CSS color names from the web and need to add them to your python module. Create the COLORS variable and assign a dict() with the names as keys and hex-colors as values. BEWARE OF THE TABS!!

  • Best score: 41
  • Best player score: 45
  • Position: #11 / 21
  • Number of attempts: 1
Add quotes to ansible playbook - 539 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

  • Best score: 8
  • Best player score: 9
  • Position: #49 / 177
  • Number of attempts: 1
Data reformat - 207 entries

Reformat this copy-paste data! #csv

  • Best score: 38
  • Best player score: 39
  • Position: #12 / 50
  • Number of attempts: 2
xrandr outputs and dashes - 528 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #3 / 175
  • Number of attempts: 1
From a Thunderlink to a Markdown link - 606 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.

  • Best score: 18
  • Best player score: 20
  • Position: #56 / 137
  • Number of attempts: 1
Yo To Hello - 923 entries

Simply Turn Yo To Hello

  • Best score: 8
  • Best player score: 10
  • Position: #3 / 434
  • Number of attempts: 1
Replace pattern with 1, 2, 3, ... on each line - 914 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

  • Best score: 21
  • Best player score: 35
  • Position: #138 / 187
  • Number of attempts: 1
Hogwarts Email Sorting - 788 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #71 / 226
  • Number of attempts: 2
Get mail address from outlook format - 549 entries

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

  • Best score: 15
  • Best player score: 15
  • Position: #15 / 170
  • Number of attempts: 1
Reconstruct the actual output from my unit test tool report - 121 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.

  • Best score: 16
  • Best player score: 16
  • Position: #1 / 41
  • Number of attempts: 2
Add text at some column - 136 entries

Complete golang struct statement.

  • Best score: 31
  • Best player score: 31
  • Position: #10 / 52
  • Number of attempts: 1
prepend * to every non-blank line - 5802 entries

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

  • Best score: 10
  • Best player score: 11
  • Position: #452 / 1428
  • Number of attempts: 1
One number per line - 18278 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1202 / 3768
  • Number of attempts: 3
Right Align Part of the line - 71 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

  • Best score: 19
  • Best player score: 20
  • Position: #10 / 27
  • Number of attempts: 2
citizen_hacks_2019_challenge2 - 160 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #35 / 81
  • Number of attempts: 1
Swap values inside brackets - 2404 entries

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Position: #167 / 555
  • Number of attempts: 1
Unsemantic linewrapping - 811 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:

  • Best score: 9
  • Best player score: 10
  • Position: #115 / 202
  • Number of attempts: 1
Refactor typescript arrow function type - 273 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 22
  • Position: #27 / 61
  • Number of attempts: 3
Extract wireshark capture filter - 168 entries

Extract wireshark capture filter from IP plan

  • Best score: 25
  • Best player score: 29
  • Position: #36 / 55
  • Number of attempts: 3
Box it - 7640 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #540 / 1825
  • Number of attempts: 3
Triangular Numbers - 75 entries

Generate the first 50 triangular numbers.

  • Best score: 18
  • Best player score: 31
  • Position: #21 / 23
  • Number of attempts: 3
Two pairs of cluster of letters creates word - 696 entries

Clean and group.

  • Best score: 17
  • Best player score: 21
  • Position: #103 / 162
  • Number of attempts: 1
Every other line - 2781 entries

AaAaAaA

  • Best score: 12
  • Best player score: 15
  • Position: #338 / 677
  • Number of attempts: 1
Convert Application Output to CSV - 166 entries

Change the application output to comma-separated values

  • Best score: 17
  • Best player score: 19
  • Position: #38 / 47
  • Number of attempts: 1
comment and uncomment code inline - 974 entries

It's very useful to be able to comment out a block of code in a quick edit. And likewise to uncomment the code. This operation often involves multi-line stanzas and even large blocks. With just line-wise navigation and insert mode this would cost you about 4 keystrokes per line. Master this hole of VimGolf and you'll quickly drop your key count in day to day Vim as well.

  • Best score: 9
  • Best player score: 10
  • Position: #182 / 290
  • Number of attempts: 1
Letterbox - 83 entries

Make a box!

  • Best score: 35
  • Best player score: 49
  • Position: #11 / 22
  • Number of attempts: 2
Flip the bit - 102 entries

Change the specific 0 to a 1.

  • Best score: 8
  • Best player score: 10
  • Position: #44 / 62
  • Number of attempts: 1
ninja substitution - 1254 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 16
  • Position: #131 / 240
  • Number of attempts: 1
Triangle of arrows - 109 entries

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

  • Best score: 14
  • Best player score: 16
  • Position: #10 / 30
  • Number of attempts: 1
One to Ten - 2066 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #82 / 632
  • Number of attempts: 1
Build a six - 265 entries

Just enjoy building "a" floors...

  • Best score: 22
  • Best player score: 22
  • Position: #23 / 88
  • Number of attempts: 2
Increment each number - 940 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 18
  • Position: #94 / 231
  • Number of attempts: 4
simple format (3) - 43 entries

reverse two column values!

  • Best score: 34
  • Best player score: 47
  • Position: #6 / 13
  • Number of attempts: 1
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

  • Best score: 13
  • Best player score: 13
  • Position: #29 / 65
  • Number of attempts: 2
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 :)

  • Best score: 15
  • Best player score: 15
  • Position: #40 / 66
  • Number of attempts: 1
change parenthesis - 235 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 9
  • Position: #61 / 133
  • Number of attempts: 1
Reorder the groups - 1082 entries

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

  • Best score: 14
  • Best player score: 14
  • Position: #57 / 247
  • Number of attempts: 1
Simple format (2) - 296 entries

try again!

  • Best score: 23
  • Best player score: 24
  • Position: #20 / 63
  • Number of attempts: 5
Resort and deup a CSV list - 128 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.

  • Best score: 44
  • Best player score: 44
  • Position: #4 / 36
  • Number of attempts: 3
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 ;-)

  • Best score: 33
  • Best player score: 41
  • Position: #26 / 49
  • Number of attempts: 6
calculations - 245 entries

Complete these (weird) calculations.

  • Best score: 38
  • Best player score: 39
  • Position: #18 / 57
  • Number of attempts: 1
Roger Stoltz
Twitter:

entered into 53 challenges

contributed 0 challenges