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

Tabbed Table to Python Array - 608 entries

Not payed by the hour? So make it fast ;-) The table contains the relative occurencies of bigrams (two consecutive letters) in 1/100,000 in the german language, copy-pasted from http://www.mathe.tu-freiberg.de/~hebisch/cafe/kryptographie/bigramme.html

  • Best score: 50
  • Best player score: 59
  • Position: #61 / 160
  • Number of attempts: 2
hello-world-vimgolf - 2311 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #21 / 653
  • Number of attempts: 1
Lowercase first characters - 458 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: #63 / 172
  • Number of attempts: 1
simple replacements - 1536 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #89 / 336
  • Number of attempts: 1
Inverting Lines - 1797 entries

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

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #7 / 306
  • Number of attempts: 2
HS Final exam vimgolf - 864 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: #37 / 227
  • Number of attempts: 2
Extend shell script - 103 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 46
  • Position: #17 / 42
  • Number of attempts: 1
Easy modification of ssh config - 335 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 26
  • Position: #41 / 104
  • Number of attempts: 1
ssh config skills - 249 entries

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

  • Best score: 41
  • Best player score: 55
  • Position: #28 / 63
  • Number of attempts: 1
Mr. Hacker - 78 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 / 32
  • Number of attempts: 2
Python: Def to Lambda - 423 entries

LAMBDA!!!

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

Turn the x to a +

  • Best score: 19
  • Best player score: 21
  • Position: #38 / 77
  • Number of attempts: 1
Format the CSS - 115 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: #19 / 43
  • Number of attempts: 1
Add quotes to ansible playbook - 872 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #87 / 274
  • Number of attempts: 1
Data reformat - 271 entries

Reformat this copy-paste data! #csv

  • Best score: 38
  • Best player score: 39
  • Position: #14 / 60
  • Number of attempts: 2
xrandr outputs and dashes - 652 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 / 213
  • Number of attempts: 1
From a Thunderlink to a Markdown link - 738 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: #73 / 165
  • Number of attempts: 1
Yo To Hello - 1107 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #2 / 512
  • Number of attempts: 1
Replace pattern with 1, 2, 3, ... on each line - 1090 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: #161 / 223
  • Number of attempts: 1
Hogwarts Email Sorting - 875 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #79 / 253
  • Number of attempts: 2
Get mail address from outlook format - 621 entries

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

  • Best score: 15
  • Best player score: 15
  • Position: #15 / 196
  • Number of attempts: 1
Reconstruct the actual output from my unit test tool report - 151 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 / 51
  • Number of attempts: 2
Add text at some column - 154 entries

Complete golang struct statement.

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #483 / 1514
  • Number of attempts: 1
One number per line - 18615 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1236 / 3841
  • Number of attempts: 3
Right Align Part of the line - 117 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 / 38
  • Number of attempts: 2
citizen_hacks_2019_challenge2 - 189 entries

For the Citizen Hacks 2019 Vim competition.

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

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Position: #171 / 569
  • Number of attempts: 1
Unsemantic linewrapping - 890 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: #125 / 224
  • Number of attempts: 1
Refactor typescript arrow function type - 302 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 22
  • Position: #32 / 68
  • Number of attempts: 3
Extract wireshark capture filter - 198 entries

Extract wireshark capture filter from IP plan

  • Best score: 25
  • Best player score: 29
  • Position: #43 / 67
  • Number of attempts: 3
Box it - 7818 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #557 / 1861
  • Number of attempts: 3
Triangular Numbers - 90 entries

Generate the first 50 triangular numbers.

  • Best score: 18
  • Best player score: 31
  • Position: #24 / 26
  • Number of attempts: 3
Two pairs of cluster of letters creates word - 735 entries

Clean and group.

  • Best score: 17
  • Best player score: 21
  • Position: #111 / 174
  • Number of attempts: 1
Every other line - 2886 entries

AaAaAaA

  • Best score: 12
  • Best player score: 15
  • Position: #350 / 700
  • Number of attempts: 1
Convert Application Output to CSV - 187 entries

Change the application output to comma-separated values

  • Best score: 17
  • Best player score: 19
  • Position: #39 / 52
  • Number of attempts: 1
comment and uncomment code inline - 1069 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: #194 / 314
  • Number of attempts: 1
Letterbox - 91 entries

Make a box!

  • Best score: 35
  • Best player score: 49
  • Position: #13 / 25
  • Number of attempts: 2
Flip the bit - 119 entries

Change the specific 0 to a 1.

  • Best score: 8
  • Best player score: 10
  • Position: #52 / 70
  • Number of attempts: 1
ninja substitution - 1372 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 16
  • Position: #147 / 261
  • Number of attempts: 1
Triangle of arrows - 166 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: #13 / 39
  • Number of attempts: 1
One to Ten - 2159 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 / 660
  • Number of attempts: 1
Build a six - 272 entries

Just enjoy building "a" floors...

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

Increment each number individually by one

  • Best score: 15
  • Best player score: 18
  • Position: #99 / 242
  • Number of attempts: 4
simple format (3) - 72 entries

reverse two column values!

  • Best score: 34
  • Best player score: 47
  • Position: #12 / 21
  • Number of attempts: 1
Around the clock - 188 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 / 74
  • Number of attempts: 2
Song Transcription Oops - 234 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 / 75
  • Number of attempts: 1
change parenthesis - 278 entries

change the pair of braces into a pair of parentheses

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

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

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

try again!

  • Best score: 23
  • Best player score: 24
  • Position: #22 / 69
  • Number of attempts: 5
Resort and deup a CSV list - 142 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 / 39
  • Number of attempts: 3
ASCII-art Histogram - 310 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: #30 / 55
  • Number of attempts: 6
calculations - 262 entries

Complete these (weird) calculations.

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

entered into 55 challenges

contributed 0 challenges