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

Fix the Scala Method - 105 entries

Fix the missing semicolons and the Int type, ensure the floating point division, and remove the unnecessary return.

  • Best score: 9
  • Best player score: 22
  • Position: #6 / 38
  • Number of attempts: 1
extract struct tag in go - 42 entries

Can you extract all struct tags in the fewest keystrokes possible?

  • Best score: 29
  • Best player score: 35
  • Position: #7 / 17
  • Number of attempts: 1
Markdown Blog Editing - 253 entries

Convert the given link text in start file to a markdown link list.

  • Best score: 30
  • Best player score: 40
  • Position: #24 / 62
  • Number of attempts: 1
Word completion - 179 entries

Try to complete these options within 20 keystrokes.

  • Best score: 20
  • Best player score: 23
  • Position: #18 / 50
  • Number of attempts: 2
Fix timezone format - 225 entries

Add the missing T and Z in the datetime field. There should be a T instead of the space, and a Z at the end of the datetime. `2024-08-31 18:32:00;` -> `2024-08-31T18:32:00Z;`

  • Best score: 15
  • Best player score: 17
  • Position: #31 / 75
  • Number of attempts: 1
Search different SQL column with similar where clause - 168 entries

Replace a column in the where clause and convert all numbers from text to numeric, by replacing the leading 0 with the code 359.

  • Best score: 22
  • Best player score: 23
  • Position: #12 / 45
  • Number of attempts: 1
Remove adjacent duplicates - 445 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 23
  • Position: #50 / 117
  • Number of attempts: 2
Move to corresponding lines - 241 entries

Move the values to the corresponding lines.

  • Best score: 16
  • Best player score: 20
  • Position: #18 / 53
  • Number of attempts: 1
Rearrange array to one line - 602 entries

Rearrange the array content on only one line, and remove trailing commas

  • Best score: 13
  • Best player score: 14
  • Position: #23 / 144
  • Number of attempts: 2
Copy punctuation - 487 entries

I want to copy the last line’s brackets, quotes, and commas to each line. How?

  • Best score: 19
  • Best player score: 22
  • Position: #20 / 121
  • Number of attempts: 2
Case matching substitution - 55 entries

Swap every "lorem" for "ipsum", keeping the letter cases the same.

  • Best score: 31
  • Best player score: 47
  • Position: #10 / 15
  • Number of attempts: 1
Morse - 148 entries

Translate Morse code to Text

  • Best score: 31
  • Best player score: 33
  • Position: #9 / 33
  • Number of attempts: 2
months to html list items - 1010 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 25
  • Position: #120 / 274
  • Number of attempts: 1
Tabbed Table to Python Array - 734 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: #72 / 179
  • Number of attempts: 2
hello-world-vimgolf - 2499 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #21 / 708
  • Number of attempts: 1
Lowercase first characters - 487 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: #68 / 183
  • Number of attempts: 1
simple replacements - 1753 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 20
  • Position: #98 / 380
  • Number of attempts: 1
Inverting Lines - 1900 entries

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

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

Simple challenge for frequent action while programming.

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

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #7 / 323
  • Number of attempts: 2
HS Final exam vimgolf - 897 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: #41 / 236
  • Number of attempts: 2
Extend shell script - 134 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 46
  • Position: #20 / 45
  • Number of attempts: 1
Easy modification of ssh config - 371 entries

Just add another alias to each worker

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

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

  • Best score: 41
  • Best player score: 55
  • Position: #29 / 66
  • Number of attempts: 1
Mr. Hacker - 89 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 / 35
  • Number of attempts: 2
Python: Def to Lambda - 455 entries

LAMBDA!!!

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

Turn the x to a +

  • Best score: 19
  • Best player score: 21
  • Position: #41 / 82
  • Number of attempts: 1
Format the CSS - 158 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: #23 / 49
  • Number of attempts: 1
Add quotes to ansible playbook - 954 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #93 / 305
  • Number of attempts: 1
Data reformat - 294 entries

Reformat this copy-paste data! #csv

  • Best score: 36
  • Best player score: 39
  • Position: #16 / 65
  • Number of attempts: 2
xrandr outputs and dashes - 704 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 / 221
  • Number of attempts: 1
From a Thunderlink to a Markdown link - 764 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: #75 / 169
  • Number of attempts: 1
Yo To Hello - 1130 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #2 / 524
  • Number of attempts: 1
Replace pattern with 1, 2, 3, ... on each line - 1146 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: #166 / 229
  • Number of attempts: 1
Hogwarts Email Sorting - 925 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #82 / 261
  • Number of attempts: 2
Get mail address from outlook format - 649 entries

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

  • Best score: 15
  • Best player score: 15
  • Position: #15 / 204
  • Number of attempts: 1
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.

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

Complete golang struct statement.

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

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

  • Best score: 10
  • Best player score: 11
  • Position: #495 / 1537
  • Number of attempts: 1
One number per line - 18727 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 17
  • Position: #1243 / 3864
  • Number of attempts: 3
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

  • Best score: 19
  • Best player score: 20
  • Position: #12 / 42
  • Number of attempts: 2
citizen_hacks_2019_challenge2 - 195 entries

For the Citizen Hacks 2019 Vim competition.

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

Easy challenge.

  • Best score: 14
  • Best player score: 15
  • Position: #174 / 579
  • Number of attempts: 1
Unsemantic linewrapping - 928 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: #128 / 231
  • Number of attempts: 1
Refactor typescript arrow function type - 323 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 22
  • Position: #35 / 71
  • Number of attempts: 3
Extract wireshark capture filter - 216 entries

Extract wireshark capture filter from IP plan

  • Best score: 25
  • Best player score: 29
  • Position: #45 / 72
  • Number of attempts: 3
Box it - 7905 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 23
  • Position: #560 / 1876
  • Number of attempts: 3
Triangular Numbers - 104 entries

Generate the first 50 triangular numbers.

  • Best score: 18
  • Best player score: 31
  • Position: #27 / 29
  • Number of attempts: 3
Two pairs of cluster of letters creates word - 749 entries

Clean and group.

  • Best score: 17
  • Best player score: 21
  • Position: #114 / 178
  • Number of attempts: 1
Every other line - 2910 entries

AaAaAaA

  • Best score: 12
  • Best player score: 15
  • Position: #352 / 703
  • Number of attempts: 1
Convert Application Output to CSV - 203 entries

Change the application output to comma-separated values

  • Best score: 17
  • Best player score: 19
  • Position: #42 / 56
  • Number of attempts: 1
comment and uncomment code inline - 1122 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: #200 / 322
  • Number of attempts: 1
Letterbox - 145 entries

Make a box!

  • Best score: 35
  • Best player score: 49
  • Position: #15 / 28
  • Number of attempts: 2
Flip the bit - 130 entries

Change the specific 0 to a 1.

  • Best score: 7
  • Best player score: 10
  • Position: #56 / 74
  • Number of attempts: 1
ninja substitution - 1420 entries

How can you reuse a previous substitution ?

  • Best score: 14
  • Best player score: 16
  • Position: #151 / 267
  • Number of attempts: 1
Triangle of arrows - 199 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: #16 / 44
  • Number of attempts: 1
One to Ten - 2219 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 / 672
  • Number of attempts: 1
Build a six - 294 entries

Just enjoy building "a" floors...

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

Increment each number individually by one

  • Best score: 15
  • Best player score: 18
  • Position: #101 / 248
  • Number of attempts: 4
simple format (3) - 86 entries

reverse two column values!

  • Best score: 34
  • Best player score: 47
  • Position: #14 / 24
  • Number of attempts: 1
Around the clock - 199 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 / 77
  • Number of attempts: 2
Song Transcription Oops - 243 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 / 78
  • Number of attempts: 1
change parenthesis - 296 entries

change the pair of braces into a pair of parentheses

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

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

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

try again!

  • Best score: 23
  • Best player score: 24
  • Position: #23 / 70
  • Number of attempts: 5
Resort and deup a CSV list - 167 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 / 43
  • Number of attempts: 3
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 ;-)

  • Best score: 33
  • Best player score: 41
  • Position: #32 / 57
  • Number of attempts: 6
calculations - 312 entries

Complete these (weird) calculations.

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

entered into 68 challenges

contributed 0 challenges