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

Insert column data on Confluence-style table - 425 entries

Add ip addresses into new "IP" column based on the last digits from the "Server" column

  • Best score: 33
  • Best player score: 33
  • Position: #2 / 99
  • Number of attempts: 5
Surround the 'z' character with brackets, quotes, and print as formatted string. - 485 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

  • Best score: 17
  • Best player score: 17
  • Position: #43 / 271
  • Number of attempts: 3
Paste a column after a column - 2243 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 14
  • Position: #46 / 487
  • Number of attempts: 3
Tabbed Table to Python Array - 643 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: 51
  • Position: #10 / 166
  • Number of attempts: 6
Fizzbuzz - 509 entries

type the first 100 lines of the fizzbuzz problem

  • Best score: 47
  • Best player score: 65
  • Position: #45 / 157
  • Number of attempts: 3
Fix the shell script! - 2338 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 27
  • Position: #104 / 540
  • Number of attempts: 5
Lowercase first characters - 467 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: #56 / 175
  • Number of attempts: 5
Make list of numbers from 1 to 30 more compact, but more confusing - 90 entries

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

  • Best score: 74
  • Best player score: 87
  • Position: #8 / 36
  • Number of attempts: 1
Generate a very basic Python constructor - 307 entries

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

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

Simple challenge for frequent action while programming.

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

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

  • Best score: 16
  • Best player score: 16
  • Position: #38 / 370
  • Number of attempts: 5
HS Final exam vimgolf - 864 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 / 227
  • Number of attempts: 5
Extend shell script - 103 entries

Just add some more stuff

  • Best score: 37
  • Best player score: 55
  • Position: #24 / 42
  • Number of attempts: 2
C to python code snippet - 78 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 / 27
  • Number of attempts: 5
Mr. Hacker - 78 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: #18 / 32
  • Number of attempts: 1
Python: Def to Lambda - 423 entries

LAMBDA!!!

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

Turn the x to a +

  • Best score: 19
  • Best player score: 19
  • Position: #1 / 77
  • Number of attempts: 10
Format the CSS - 115 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: #17 / 43
  • Number of attempts: 4
Rural Post - 4362 entries

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

  • Best score: 9
  • Best player score: 10
  • Position: #247 / 1071
  • Number of attempts: 2
Levenshtein distance - 104 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: 27
  • Best player score: 28
  • Position: #5 / 36
  • Number of attempts: 5
Satisfy the go linter - 2329 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 / 457
  • Number of attempts: 11
Add quotes to ansible playbook - 926 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #122 / 295
  • Number of attempts: 2
Multiline to Single Line - 668 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #72 / 292
  • Number of attempts: 1
xrandr outputs and dashes - 652 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 / 213
  • Number of attempts: 2
From a Thunderlink to a Markdown link - 747 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 / 166
  • Number of attempts: 8
Yo To Hello - 1114 entries

Simply Turn Yo To Hello

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

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

  • Best score: 20
  • Best player score: 21
  • Position: #85 / 254
  • Number of attempts: 3
Get mail address from outlook format - 621 entries

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

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

Well, swap the values...

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

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

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

For the Citizen Hacks 2019 Vim competition

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

Just give me the numbers.

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

Complete golang import statement.

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

Will you use isk ?

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

Easy challenge.

  • Best score: 14
  • Best player score: 14
  • Position: #93 / 569
  • Number of attempts: 3
Unsemantic linewrapping - 890 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 / 224
  • Number of attempts: 2
V to the i - 4751 entries

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

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

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

  • Best score: 12
  • Best player score: 14
  • Position: #465 / 840
  • Number of attempts: 1
Refactor typescript arrow function type - 302 entries

Make arrow function type less verbose and easier to read

  • Best score: 20
  • Best player score: 23
  • Position: #39 / 68
  • Number of attempts: 1
Add string initializers to an enum - 862 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 21
  • Position: #52 / 254
  • Number of attempts: 4
SCREAMING_SNAKE_CASE to Title Case - 1181 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: #97 / 244
  • Number of attempts: 1
Add semicolons - 10792 entries

Simply add a semicolon at the end of each line

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

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

  • Best score: 18
  • Best player score: 20
  • Position: #265 / 516
  • Number of attempts: 3
remove lines containing the word "reader" - 3537 entries

easy stuff

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

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

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

For the Citizen Hacks 2019 Vim competition

  • Best score: 38
  • Best player score: 38
  • Position: #1 / 8
  • 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 - 7827 entries

Create a box around a line.

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

abc trying to be cool or not...

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

AaAaAaA

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

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

  • Best score: 13
  • Best player score: 18
  • Position: #355 / 635
  • Number of attempts: 2
Just the middle - 11360 entries

Delete the instructions at the top and bottom.

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

The team names are misspelled.

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

Renumbering Basic.

  • Best score: 11
  • Best player score: 11
  • Position: #234 / 1258
  • Number of attempts: 1
Fiddle percentages into real numbers - 840 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 / 287
  • Number of attempts: 3
Vice versa - 7803 entries

Little role switching.

  • Best score: 12
  • Best player score: 12
  • Position: #560 / 2100
  • Number of attempts: 6
mp3 - Cutlist - 29 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: 65
  • Best player score: 67
  • Position: #2 / 12
  • Number of attempts: 6
One to Ten - 2165 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 / 662
  • Number of attempts: 2
Increment each number - 977 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 18
  • Position: #113 / 242
  • Number of attempts: 2
Reorder the groups - 1137 entries

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

  • Best score: 14
  • Best player score: 16
  • Position: #125 / 259
  • Number of attempts: 2
Collect List - 4264 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #490 / 1186
  • 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 - 15931 entries

Oops.

  • Best score: 10
  • Best player score: 11
  • Position: #1223 / 4161
  • Number of attempts: 4
-a-b-c- - 3176 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 13
  • Position: #293 / 1129
  • 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 - 12854 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 15
  • Position: #1826 / 3945
  • Number of attempts: 1
Presidential Sorting - 48 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 / 23
  • Number of attempts: 1
citizen_hacks_2019_part9 - 24 entries

For the Citizen Hacks 2019 Vim competition

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

For the Citizen Hacks 2019 Vim competition

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

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

  • Best score: 25
  • Best player score: 38
  • Position: #71 / 103
  • Number of attempts: 4
Simple text editing with Vim - 12281 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 / 3580
  • Number of attempts: 3
Tanzeel Kazi
Twitter:

Software developer

entered into 72 challenges

contributed 0 challenges