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 - 211 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: 35
  • Position: #26 / 78
  • Number of attempts: 5
Make list of numbers from 1 to 30 more compact, but more confusing - 70 entries

Change the naming logic of numbers to end up with less lines.

  • Best score: 75
  • Best player score: 87
  • Position: #5 / 25
  • Number of attempts: 1
Generate a very basic Python constructor - 188 entries

I actually needed to do this myself, so I look forward to learning how.

  • Best score: 38
  • Best player score: 38
  • Position: #16 / 50
  • Number of attempts: 6
Making 3 line function a one liner. - 94 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #62 / 68
  • Number of attempts: 1
swap number pairs - 1294 entries

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

  • Best score: 16
  • Best player score: 16
  • Position: #38 / 244
  • Number of attempts: 5
HS Final exam vimgolf - 578 entries

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

  • Best score: 21
  • Best player score: 21
  • Position: #21 / 156
  • Number of attempts: 5
Extend shell script - 66 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 55
  • Position: #16 / 26
  • Number of attempts: 2
C to python code snippet - 44 entries

C code can be easily translated into Python code. However, the difference in syntax can make this process tedious and time-consuming. Can Vim help you here?

  • Best score: 48
  • Best player score: 49
  • Position: #4 / 15
  • Number of attempts: 5
Mr. Hacker - 34 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: 20
  • Position: #11 / 17
  • Number of attempts: 1
Python: Def to Lambda - 221 entries

LAMBDA!!!

  • Best score: 19
  • Best player score: 19
  • Position: #17 / 80
  • Number of attempts: 2
Turn the x - 174 entries

Turn the x to a +

  • Best score: 19
  • Best player score: 19
  • Position: #1 / 48
  • Number of attempts: 10
Format the CSS - 57 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: 44
  • Position: #10 / 24
  • Number of attempts: 4
Rural Post - 3800 entries

Simple challenge to remove all but the post code on each line

  • Best score: 9
  • Best player score: 10
  • Position: #216 / 939
  • Number of attempts: 2
Levenshtein distance - 70 entries

Compute distance for each pair. Notice that this recursive implementation is very inefficient. Wagner-Fischer algorithm is iterative and much faster. #vimscript

  • Best score: 28
  • Best player score: 28
  • Position: #2 / 25
  • Number of attempts: 5
Satisfy the go linter - 1625 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: #37 / 334
  • Number of attempts: 11
Add quotes to ansible playbook - 597 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #84 / 190
  • Number of attempts: 2
Multiline to Single Line - 378 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #72 / 179
  • Number of attempts: 1
xrandr outputs and dashes - 568 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: #78 / 184
  • Number of attempts: 2
From a Thunderlink to a Markdown link - 659 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: 18
  • Position: #52 / 145
  • Number of attempts: 8
Yo To Hello - 983 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #191 / 454
  • Number of attempts: 3
Simple, Practical, and Common - 32778 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 22
  • Position: #2223 / 7242
  • Number of attempts: 8
Hogwarts Email Sorting - 806 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #78 / 231
  • Number of attempts: 3
Get mail address from outlook format - 560 entries

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

  • Best score: 15
  • Best player score: 15
  • Position: #45 / 173
  • Number of attempts: 2
Swap values - 4409 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 11
  • Position: #330 / 1235
  • Number of attempts: 4
prepend * to every non-blank line - 5829 entries

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

  • Best score: 10
  • Best player score: 10
  • Position: #253 / 1434
  • Number of attempts: 4
citizen_hacks_2019_part1 - 19 entries

For the Citizen Hacks 2019 Vim competition

  • Best score: 52
  • Best player score: 52
  • Position: #2 / 9
  • Number of attempts: 3
One number per line - 18295 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 14
  • Position: #676 / 3770
  • Number of attempts: 13
Quote modules - 985 entries

Complete golang import statement.

  • Best score: 21
  • Best player score: 22
  • Position: #60 / 252
  • Number of attempts: 5
TAR archive pretty print - 22 entries

Will you use isk ?

  • Best score: 24
  • Best player score: 25
  • Position: #5 / 10
  • Number of attempts: 3
Swap values inside brackets - 2417 entries

Easy challenge.

  • Best score: 14
  • Best player score: 14
  • Position: #93 / 557
  • Number of attempts: 3
Unsemantic linewrapping - 821 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: 9
  • Position: #75 / 205
  • Number of attempts: 2
V to the i - 4617 entries

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

  • Best score: 7
  • Best player score: 7
  • Position: #742 / 1847
  • Number of attempts: 2
Applying same text modification in several lines - 2713 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 12
  • Best player score: 14
  • Position: #441 / 807
  • Number of attempts: 1
Refactor typescript arrow function type - 278 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 23
  • Position: #35 / 62
  • Number of attempts: 1
Add string initializers to an enum - 737 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 21
  • Position: #52 / 220
  • Number of attempts: 4
SCREAMING_SNAKE_CASE to Title Case - 1089 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

  • Best score: 19
  • Best player score: 20
  • Position: #91 / 227
  • Number of attempts: 1
Add semicolons - 10467 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #599 / 2966
  • Number of attempts: 3
Bad Copy Syntax - 1904 entries

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

  • Best score: 18
  • Best player score: 20
  • Position: #247 / 485
  • Number of attempts: 3
remove lines containing the word "reader" - 3436 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #432 / 1113
  • Number of attempts: 2
Com(m)a Trouble - 3308 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 12
  • Position: #123 / 746
  • Number of attempts: 6
citizen_hacks_2019_part4 - 7 entries

For the Citizen Hacks 2019 Vim competition

  • Best score: 38
  • Best player score: 38
  • Position: #1 / 6
  • Number of attempts: 1
citizen_hacks_2019_part2 - 10 entries

For the Citizen Hacks 2019 Vim competition

  • Best score: 41
  • Best player score: 41
  • Position: #2 / 5
  • Number of attempts: 4
Box it - 7661 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #441 / 1830
  • Number of attempts: 5
Cool or not? - 748 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 15
  • Position: #60 / 214
  • Number of attempts: 4
Every other line - 2790 entries

AaAaAaA

  • Best score: 12
  • Best player score: 12
  • Position: #68 / 679
  • Number of attempts: 6
Copy three lines - 2767 entries

If the site is up (by some miracle), make the text under every header identical.

  • Best score: 13
  • Best player score: 18
  • Position: #347 / 620
  • Number of attempts: 2
Just the middle - 11086 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1407 / 4093
  • Number of attempts: 2
Team names - 1767 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 16
  • Position: #261 / 566
  • Number of attempts: 1
Basic renumbering - 5408 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #234 / 1221
  • Number of attempts: 1
Fiddle percentages into real numbers - 794 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: 13
  • Position: #144 / 270
  • Number of attempts: 3
Vice versa - 7462 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #560 / 2023
  • Number of attempts: 6
mp3 - Cutlist - 28 entries

An audio CD was accidentally ripped into one single mp3 file. A dummy cue-file now needs to be filled out with the correct values to get single mp3 files.

  • Best score: 67
  • Best player score: 67
  • Position: #1 / 11
  • Number of attempts: 6
One to Ten - 2072 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: #296 / 635
  • Number of attempts: 2
Increment each number - 946 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 18
  • Position: #108 / 233
  • Number of attempts: 2
Reorder the groups - 1095 entries

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

  • Best score: 14
  • Best player score: 16
  • Position: #116 / 249
  • Number of attempts: 2
Collect List - 4155 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #490 / 1161
  • Number of attempts: 2
Simple Maths - 35 entries

Not much to say, discover by yourself!

  • Best score: 26
  • Best player score: 41
  • Position: #20 / 23
  • Number of attempts: 1
I forgot quotes - 15668 entries

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1207 / 4099
  • Number of attempts: 4
-a-b-c- - 3085 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #293 / 1101
  • Number of attempts: 4
Untangle my tail, please! - 47 entries

You know, this words were playing to chase their tails and Oops! What happened? Now we have a complete mess, their tails are totally tangled, can you please help them to untangle their tails?

  • Best score: 16
  • Best player score: 18
  • Position: #24 / 28
  • Number of attempts: 1
Words in parens - 12690 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1802 / 3906
  • Number of attempts: 1
Presidential Sorting - 47 entries

Given a nice CSV formatted arrangement of the Presidents of the United States, we need to print out an alphabetical list in pretty columns. Prove that vim can conquer this basic Excel task!

  • Best score: 40
  • Best player score: 48
  • Position: #13 / 22
  • Number of attempts: 1
citizen_hacks_2019_part9 - 13 entries

For the Citizen Hacks 2019 Vim competition

  • Best score: 48
  • Best player score: 48
  • Position: #1 / 4
  • Number of attempts: 4
citizen_hacks_2019_challenge1 - 31 entries

For the Citizen Hacks 2019 Vim competition

  • Best score: 5
  • Best player score: 5
  • Position: #21 / 27
  • Number of attempts: 1
Alphabet soup - 354 entries

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

  • Best score: 25
  • Best player score: 38
  • Position: #59 / 84
  • Number of attempts: 4
Simple text editing with Vim - 11446 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 13
  • Position: #637 / 3361
  • Number of attempts: 3
Tanzeel Kazi
Twitter:

Software developer

entered into 66 challenges

contributed 0 challenges