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 - 421 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: #49 / 152
  • Number of attempts: 5
Make list of numbers from 1 to 30 more compact, but more confusing - 81 entries

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

  • Best score: 75
  • Best player score: 87
  • Position: #6 / 33
  • Number of attempts: 1
Generate a very basic Python constructor - 292 entries

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

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

Simple challenge for frequent action while programming.

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

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

  • Best score: 16
  • Best player score: 16
  • Position: #38 / 346
  • Number of attempts: 5
HS Final exam vimgolf - 804 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 / 215
  • Number of attempts: 5
Extend shell script - 92 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 55
  • Position: #22 / 39
  • Number of attempts: 2
C to python code snippet - 70 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 / 24
  • Number of attempts: 5
Mr. Hacker - 76 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: #17 / 31
  • Number of attempts: 1
Python: Def to Lambda - 410 entries

LAMBDA!!!

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

Turn the x to a +

  • Best score: 19
  • Best player score: 19
  • Position: #1 / 71
  • Number of attempts: 10
Format the CSS - 109 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: #15 / 40
  • Number of attempts: 4
Rural Post - 4254 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #240 / 1044
  • Number of attempts: 2
Levenshtein distance - 88 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 / 31
  • Number of attempts: 5
Satisfy the go linter - 2076 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 / 422
  • Number of attempts: 11
Add quotes to ansible playbook - 845 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #118 / 267
  • Number of attempts: 2
Multiline to Single Line - 585 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #72 / 260
  • Number of attempts: 1
xrandr outputs and dashes - 624 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 / 205
  • Number of attempts: 2
From a Thunderlink to a Markdown link - 720 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 / 160
  • Number of attempts: 8
Yo To Hello - 1081 entries

Simply Turn Yo To Hello

  • Best score: 10
  • Best player score: 10
  • Position: #191 / 497
  • Number of attempts: 3
Simple, Practical, and Common - 33124 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: #2222 / 7307
  • Number of attempts: 8
Hogwarts Email Sorting - 850 entries

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

  • Best score: 20
  • Best player score: 21
  • Position: #82 / 247
  • Number of attempts: 3
Get mail address from outlook format - 604 entries

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

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

Well, swap the values...

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

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

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

For the Citizen Hacks 2019 Vim competition

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

Just give me the numbers.

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

Complete golang import statement.

  • Best score: 21
  • Best player score: 22
  • Position: #63 / 263
  • 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 - 2442 entries

Easy challenge.

  • Best score: 14
  • Best player score: 14
  • Position: #93 / 565
  • Number of attempts: 3
Unsemantic linewrapping - 861 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 / 218
  • Number of attempts: 2
V to the i - 4651 entries

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

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

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

  • Best score: 12
  • Best player score: 14
  • Position: #457 / 827
  • Number of attempts: 1
Refactor typescript arrow function type - 295 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 23
  • Position: #37 / 66
  • Number of attempts: 1
Add string initializers to an enum - 836 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 21
  • Position: #52 / 246
  • Number of attempts: 4
SCREAMING_SNAKE_CASE to Title Case - 1124 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: #94 / 235
  • Number of attempts: 1
Add semicolons - 10720 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 10
  • Position: #598 / 3023
  • Number of attempts: 3
Bad Copy Syntax - 1952 entries

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

  • Best score: 18
  • Best player score: 20
  • Position: #257 / 502
  • Number of attempts: 3
remove lines containing the word "reader" - 3483 entries

easy stuff

  • Best score: 9
  • Best player score: 9
  • Position: #431 / 1128
  • Number of attempts: 2
Com(m)a Trouble - 3511 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #123 / 789
  • 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 - 7746 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #440 / 1846
  • Number of attempts: 5
Cool or not? - 767 entries

abc trying to be cool or not...

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

AaAaAaA

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

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

  • Best score: 13
  • Best player score: 18
  • Position: #353 / 630
  • Number of attempts: 2
Just the middle - 11289 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 7
  • Position: #1406 / 4144
  • Number of attempts: 2
Team names - 1790 entries

The team names are misspelled.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #234 / 1245
  • Number of attempts: 1
Fiddle percentages into real numbers - 825 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 / 281
  • Number of attempts: 3
Vice versa - 7643 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #560 / 2072
  • 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 - 2123 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 / 650
  • Number of attempts: 2
Increment each number - 959 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 18
  • Position: #110 / 238
  • Number of attempts: 2
Reorder the groups - 1120 entries

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

  • Best score: 14
  • Best player score: 16
  • Position: #121 / 255
  • Number of attempts: 2
Collect List - 4212 entries

Convert to comma separated list.

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

Not much to say, discover by yourself!

  • Best score: 26
  • Best player score: 41
  • Position: #21 / 25
  • Number of attempts: 1
I forgot quotes - 15852 entries

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1218 / 4136
  • Number of attempts: 4
-a-b-c- - 3149 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #293 / 1121
  • Number of attempts: 4
Untangle my tail, please! - 57 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: #27 / 31
  • Number of attempts: 1
Words in parens - 12790 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1818 / 3932
  • 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 - 16 entries

For the Citizen Hacks 2019 Vim competition

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

For the Citizen Hacks 2019 Vim competition

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

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

  • Best score: 25
  • Best player score: 38
  • Position: #67 / 98
  • Number of attempts: 4
Simple text editing with Vim - 11896 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 / 3481
  • Number of attempts: 3
Tanzeel Kazi
Twitter:

Software developer

entered into 66 challenges

contributed 0 challenges