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 - 366 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: #44 / 131
  • Number of attempts: 5
Make list of numbers from 1 to 30 more compact, but more confusing - 76 entries

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

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

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

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

Simple challenge for frequent action while programming.

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

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

  • Best score: 16
  • Best player score: 16
  • Position: #38 / 291
  • Number of attempts: 5
HS Final exam vimgolf - 685 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 / 183
  • Number of attempts: 5
Extend shell script - 83 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 55
  • Position: #19 / 32
  • Number of attempts: 2
C to python code snippet - 62 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: #5 / 21
  • Number of attempts: 5
Mr. Hacker - 65 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: #16 / 27
  • Number of attempts: 1
Python: Def to Lambda - 378 entries

LAMBDA!!!

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

Turn the x to a +

  • Best score: 19
  • Best player score: 19
  • Position: #1 / 67
  • Number of attempts: 10
Format the CSS - 92 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: #13 / 36
  • Number of attempts: 4
Rural Post - 4117 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #230 / 1018
  • Number of attempts: 2
Levenshtein distance - 76 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 / 27
  • Number of attempts: 5
Satisfy the go linter - 2013 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 / 405
  • Number of attempts: 11
Add quotes to ansible playbook - 795 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #113 / 250
  • Number of attempts: 2
Multiline to Single Line - 525 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #72 / 237
  • Number of attempts: 1
xrandr outputs and dashes - 591 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 / 193
  • Number of attempts: 2
From a Thunderlink to a Markdown link - 703 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 / 156
  • Number of attempts: 8
Yo To Hello - 1051 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #191 / 483
  • Number of attempts: 3
Simple, Practical, and Common - 32962 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 / 7276
  • Number of attempts: 8
Hogwarts Email Sorting - 831 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #80 / 238
  • Number of attempts: 3
Get mail address from outlook format - 596 entries

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

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

Well, swap the values...

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

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

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

For the Citizen Hacks 2019 Vim competition

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

Just give me the numbers.

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

Complete golang import statement.

  • Best score: 21
  • Best player score: 22
  • Position: #62 / 260
  • 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 - 2433 entries

Easy challenge.

  • Best score: 14
  • Best player score: 14
  • Position: #93 / 561
  • Number of attempts: 3
Unsemantic linewrapping - 837 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 / 210
  • Number of attempts: 2
V to the i - 4641 entries

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

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

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

  • Best score: 12
  • Best player score: 14
  • Position: #449 / 815
  • Number of attempts: 1
Refactor typescript arrow function type - 287 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 23
  • Position: #36 / 63
  • Number of attempts: 1
Add string initializers to an enum - 774 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 21
  • Position: #52 / 228
  • Number of attempts: 4
SCREAMING_SNAKE_CASE to Title Case - 1120 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: #93 / 233
  • Number of attempts: 1
Add semicolons - 10545 entries

Simply add a semicolon at the end of each line

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

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

  • Best score: 18
  • Best player score: 20
  • Position: #254 / 493
  • Number of attempts: 3
remove lines containing the word "reader" - 3454 entries

easy stuff

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

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

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

For the Citizen Hacks 2019 Vim competition

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

For the Citizen Hacks 2019 Vim competition

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

Create a box around a line.

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

abc trying to be cool or not...

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

AaAaAaA

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

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

  • Best score: 13
  • Best player score: 18
  • Position: #351 / 625
  • Number of attempts: 2
Just the middle - 11141 entries

Delete the instructions at the top and bottom.

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

The team names are misspelled.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #234 / 1228
  • Number of attempts: 1
Fiddle percentages into real numbers - 798 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 / 273
  • Number of attempts: 3
Vice versa - 7536 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #560 / 2049
  • 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 - 2095 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 / 642
  • 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 - 1112 entries

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

  • Best score: 14
  • Best player score: 16
  • Position: #119 / 252
  • Number of attempts: 2
Collect List - 4184 entries

Convert to comma separated list.

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

Not much to say, discover by yourself!

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

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1212 / 4116
  • Number of attempts: 4
-a-b-c- - 3118 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #293 / 1112
  • Number of attempts: 4
Untangle my tail, please! - 54 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: #26 / 30
  • Number of attempts: 1
Words in parens - 12736 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1810 / 3919
  • 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 - 15 entries

For the Citizen Hacks 2019 Vim competition

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

For the Citizen Hacks 2019 Vim competition

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

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

  • Best score: 25
  • Best player score: 38
  • Position: #66 / 93
  • Number of attempts: 4
Simple text editing with Vim - 11657 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 / 3418
  • Number of attempts: 3
Tanzeel Kazi
Twitter:

Software developer

entered into 66 challenges

contributed 0 challenges