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 - 144 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: 41
  • Position: #29 / 50
  • Number of attempts: 2
simple replacements - 553 entries

The goal is to see the replacement commands in action.

  • Best score: 19
  • Best player score: 19
  • Position: #14 / 129
  • Number of attempts: 7
Inverting Lines - 832 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #92 / 232
  • Number of attempts: 6
CSV to MD format - 163 entries

To convert a CSV list to Markdown list

  • Best score: 36
  • Best player score: 36
  • Position: #7 / 43
  • Number of attempts: 9
Python dataclasses - 346 entries

Simple challenge to extract fields from a Python class

  • Best score: 9
  • Best player score: 19
  • Position: #13 / 97
  • Number of attempts: 3
RUST Cargo.toml version to last - 168 entries

RUST Cargo.toml version to last. rusty practice on vimgolf

  • Best score: 16
  • Best player score: 16
  • Position: #11 / 53
  • Number of attempts: 4
RUST match with enum for Coin - 109 entries

RUST match with enum for Coin rusty practice on vimgolf

  • Best score: 85
  • Best player score: 105
  • Position: #16 / 32
  • Number of attempts: 2
Modernise code - 588 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 34
  • Position: #32 / 137
  • Number of attempts: 15
swap number pairs - 1193 entries

Swap the numbers in a bunch of 2-element arrays.

  • Best score: 16
  • Best player score: 16
  • Position: #31 / 223
  • Number of attempts: 19
HS Final exam vimgolf - 539 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: #49 / 147
  • Number of attempts: 3
Easy modification of ssh config - 144 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 24
  • Position: #16 / 44
  • Number of attempts: 8
ssh config skills - 149 entries

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

  • Best score: 41
  • Best player score: 60
  • Position: #25 / 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: #5 / 16
  • Number of attempts: 4
Python: Def to Lambda - 195 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 19
  • Position: #33 / 68
  • Number of attempts: 2
Turn the x - 151 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 28
  • Position: #40 / 43
  • Number of attempts: 1
Satisfy the go linter - 1556 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 20
  • Position: #106 / 322
  • Number of attempts: 9
Add quotes to ansible playbook - 537 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #109 / 176
  • Number of attempts: 4
Multiline to Single Line - 341 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #117 / 162
  • Number of attempts: 1
Data reformat - 207 entries

Reformat this copy-paste data! #csv

  • Best score: 38
  • Best player score: 55
  • Position: #30 / 50
  • Number of attempts: 8
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: #116 / 175
  • Number of attempts: 5
Capitalize the Names - 254 entries

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

  • Best score: 3
  • Best player score: 21
  • Position: #28 / 66
  • Number of attempts: 9
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: 21
  • Position: #36 / 187
  • Number of attempts: 14
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: #87 / 226
  • Number of attempts: 4
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: #67 / 170
  • Number of attempts: 10
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: #20 / 41
  • Number of attempts: 5
Add text at some column - 136 entries

Complete golang struct statement.

  • Best score: 31
  • Best player score: 32
  • Position: #30 / 52
  • Number of attempts: 2
prepend * to every non-blank line - 5800 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #408 / 1427
  • 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: 19
  • Position: #4 / 27
  • Number of attempts: 6
TAR archive pretty print - 22 entries

Will you use isk ?

  • Best score: 24
  • Best player score: 25
  • Position: #6 / 10
  • Number of attempts: 5
Quote modules (ver.2) - 175 entries

Complete golang import statement.

  • Best score: 22
  • Best player score: 23
  • Position: #20 / 46
  • Number of attempts: 12
Separate the lines - 152 entries

Every other line is mixed up. Separate them into their original texts.

  • Best score: 11
  • Best player score: 11
  • Position: #52 / 82
  • Number of attempts: 7
citizen_hacks_2019_challenge2 - 159 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 7
  • Position: #74 / 80
  • Number of attempts: 1
Palindrome numbers - 21 entries

For each number compute its associated palindrome. First number (first line) has been eaten! #prime

  • Best score: 30
  • Best player score: 33
  • Position: #9 / 14
  • Number of attempts: 3
V to the i - 4600 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 7
  • Position: #773 / 1839
  • Number of attempts: 2
Refactor typescript arrow function type - 273 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 20
  • Position: #22 / 61
  • Number of attempts: 7
Add semicolons - 10448 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1705 / 2958
  • Number of attempts: 6
remove lines containing the word "reader" - 3426 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #480 / 1110
  • Number of attempts: 4
Box it - 7637 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 28
  • Position: #1239 / 1824
  • Number of attempts: 3
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.

  • Best score: 10
  • Best player score: 11
  • Position: #29 / 36
  • Number of attempts: 3
Triangular Numbers - 75 entries

Generate the first 50 triangular numbers.

  • Best score: 18
  • Best player score: 18
  • Position: #15 / 23
  • Number of attempts: 8
multiple cursor alternative - 1419 entries

from: https://www.reddit.com/r/vim/comments/6w5pfa/crosspost_from_remacs_how_would_you_do_this_in_vim/

  • Best score: 19
  • Best player score: 19
  • Position: #91 / 364
  • Number of attempts: 6
Convert Application Output to CSV - 166 entries

Change the application output to comma-separated values

  • Best score: 17
  • Best player score: 17
  • Position: #33 / 47
  • Number of attempts: 4
Preferably without multi-cursor plugin - 459 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

  • Best score: 30
  • Best player score: 30
  • Position: #20 / 114
  • Number of attempts: 8
Number Sort - 281 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 10
  • Position: #141 / 149
  • Number of attempts: 2
Flip the bit - 102 entries

Change the specific 0 to a 1.

  • Best score: 8
  • Best player score: 8
  • Position: #32 / 62
  • Number of attempts: 3
Learn some german verbs - 491 entries

The list needs to be structured so we can print in verbatim and feel ok about how it looks.

  • Best score: 21
  • Best player score: 21
  • Position: #50 / 122
  • Number of attempts: 5
Todo list specification - 359 entries

The every item on the todo list must be done today. Modify the list to reflect that.

  • Best score: 37
  • Best player score: 37
  • Position: #90 / 164
  • Number of attempts: 5
For all cases. - 122 entries

In this case... change it! :) Watch the line.

  • Best score: 8
  • Best player score: 8
  • Position: #76 / 86
  • Number of attempts: 1
Stairstep digits - 237 entries

Remove the evens. Double the odds.

  • Best score: 9
  • Best player score: 9
  • Position: #45 / 112
  • Number of attempts: 4
Back to the roots - 43 entries

Johnny has a file with more integers. He wants to change each number with its square root. Can you help him?

  • Best score: 23
  • Best player score: 23
  • Position: #26 / 30
  • Number of attempts: 1
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 43 entries

I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!

  • Best score: 18
  • Best player score: 18
  • Position: #25 / 27
  • Number of attempts: 1
Missing Library and a Typo - 826 entries

I forgot to add a c library, please add it for me. Also I'm bad at typing so fix my typo too.

  • Best score: 15
  • Best player score: 17
  • Position: #114 / 202
  • Number of attempts: 10
Long prime list - filter version - 24 entries

I've used the maximum input/diff/output size allowed by vimgolf to get a list of integers up to 1460 separated by newlines, and your goal is to only keep the lines containing primes. There are 232 of them I hope some of you will golf vimscript itself to create some function to run as a primality check for each line, which is a good exercise if you haven't done much vimscript yet! You're invited to also try copy-pasting and doing other non-smart text manipulation. Even more interesting would be to see a solution that uses text manipulation to do the filtering! Whether you use vimscript, normal-mode primality checks, or text manipulation, as long as the end result is valid, your answer will be valid! Let's see which method does better here. Best of luck!

  • Best score: 28
  • Best player score: 28
  • Position: #3 / 7
  • Number of attempts: 5
Basic renumbering - 5395 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #255 / 1219
  • Number of attempts: 2
create arrows in a list - 78 entries

Add arrow at same distance

  • Best score: 10
  • Best player score: 10
  • Position: #54 / 59
  • Number of attempts: 4
sort python functions and methods alphabetically - 17 entries

* sort functions in the python file alphabetically * sort functions within a Class alphabetically * sort Classes alphabetically

  • Best score: 20
  • Best player score: 20
  • Position: #6 / 10
  • Number of attempts: 3
Create a table - 289 entries

Convert the given input into a formatted table

  • Best score: 16
  • Best player score: 16
  • Position: #45 / 94
  • Number of attempts: 9
Fiddle percentages into real numbers - 791 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 20
  • Position: #253 / 269
  • Number of attempts: 1
Add to end of each line... kinda - 285 entries

Visual-block mode can be used to add something to the end of each line, even if they are of differing lengths. However, what if it's not quite at the end?

  • Best score: 12
  • Best player score: 13
  • Position: #139 / 153
  • Number of attempts: 1
Pretty multi-line bash - 212 entries

Bash line continuations are much prettier when they're column aligned.

  • Best score: 15
  • Best player score: 19
  • Position: #32 / 72
  • Number of attempts: 2
Paragraph sort - 394 entries

My large herbivorous mammals, Vim commands, and POSIX utilities need to be sorted separately.

  • Best score: 14
  • Best player score: 14
  • Position: #42 / 114
  • Number of attempts: 18
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: 14
  • Position: #9 / 30
  • Number of attempts: 11
Order and join - 853 entries

There's something special about the input order.

  • Best score: 10
  • Best player score: 10
  • Position: #74 / 235
  • Number of attempts: 6
Paragraph breaks - 477 entries

Swap the blank lines and the aaa lines.

  • Best score: 10
  • Best player score: 11
  • Position: #81 / 158
  • Number of attempts: 13
Mirrored text - 161 entries

backward and forward, and long enough to be challenging

  • Best score: 14
  • Best player score: 15
  • Position: #30 / 68
  • Number of attempts: 1
Generate a list of numbers - 269 entries

Please generate list of numbers from 1 to 20.

  • Best score: 14
  • Best player score: 14
  • Position: #59 / 127
  • Number of attempts: 4
One to Ten - 2063 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: #336 / 631
  • Number of attempts: 5
citizen_hacks_2019_challenge5 - 109 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #36 / 57
  • Number of attempts: 3
Increment each number - 940 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 16
  • Position: #83 / 231
  • Number of attempts: 8
Join 'em - 211 entries

This shouldn't be too tough

  • Best score: 4
  • Best player score: 4
  • Position: #5 / 123
  • Number of attempts: 1
Delete to the end of the current line - 709 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 5
  • Position: #244 / 347
  • Number of attempts: 1
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: #51 / 66
  • Number of attempts: 6
change parenthesis - 235 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 9
  • Position: #79 / 133
  • Number of attempts: 2
Remove quotes after first field - 311 entries

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

  • Best score: 16
  • Best player score: 18
  • Position: #35 / 77
  • Number of attempts: 7
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: #86 / 247
  • Number of attempts: 11
Add Go XML to structure tags - 143 entries

The Go programming language can directly map XML to structure fields. Add the correct XML tag after each field.

  • Best score: 23
  • Best player score: 24
  • Position: #13 / 60
  • Number of attempts: 9
move titles next to url, in quotes - 464 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 19
  • Position: #11 / 124
  • Number of attempts: 6
Assign numbers to fields - 91 entries

You are given a list of space-separated strings. Add an increasing numeric prefix to each one.

  • Best score: 19
  • Best player score: 21
  • Position: #43 / 51
  • Number of attempts: 1
Mirror Symmetry - 752 entries

Add backslashes.

  • Best score: 7
  • Best player score: 7
  • Position: #89 / 257
  • Number of attempts: 6
Simple format (2) - 296 entries

try again!

  • Best score: 23
  • Best player score: 23
  • Position: #17 / 63
  • Number of attempts: 13
Line 'em up! - 347 entries

It can be so hard to keep everything neatly lined-up. Somebody clearly hasn't bothered here. Tidy it up, please!

  • Best score: 17
  • Best player score: 18
  • Position: #49 / 102
  • Number of attempts: 20
50 factorials mod 97 - 44 entries

List 1! to 50!, but give your answer mod 97.

  • Best score: 28
  • Best player score: 29
  • Position: #7 / 17
  • Number of attempts: 6
Sorting database text output - 201 entries

Sometimes it is nice to be able to quickly take column-formatted text output from the SQL command line and turn it into a list of useful data. In this case we want a unique, sorted list of the values from the second column combined into one comma-separated list. What is the fewest strokes you can do this in?

  • Best score: 24
  • Best player score: 25
  • Position: #49 / 76
  • Number of attempts: 7
Comparing scores - 78 entries

If Alice and Bob both did the challenge, put their entries together in the top paragraph, so we can compare their scores more easily.

  • Best score: 18
  • Best player score: 21
  • Position: #11 / 30
  • Number of attempts: 9
NATO phonetic alphabet - 450 entries

Transform the series of words into a list.

  • Best score: 19
  • Best player score: 20
  • Position: #49 / 169
  • Number of attempts: 7
Alphabet soup - 337 entries

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

  • Best score: 25
  • Best player score: 26
  • Position: #39 / 80
  • Number of attempts: 3
calculations - 245 entries

Complete these (weird) calculations.

  • Best score: 38
  • Best player score: 38
  • Position: #14 / 57
  • Number of attempts: 8
pikjes
Twitter:

entered into 87 challenges

contributed 0 challenges