Alignment and formatting helpers for whitespace, symbols, and transposing. ([Marketplace]) ([GitHub])
This extension exposes four types of alignment and formmatting helper commands. Due to variations between operating systems and keyboard shortcut preferences, it no longer adds any keyboard shortcuts automatically, but see below for some suggestions and instructions on adding your own set of keyboard shortcuts. This is intended to be a semi-opinionated approach with some obvious room for improvement. Please open an [issue] on [GitHub] if you believe something should be different or configurable and we can discuss a PR or I'll make a quick change.
Each of the four main commands behave differently depending on if a single line or multiple lines are selected. If only a single line is selected (see above), then the transposing commands will attempt to split it into multiple lines. For alignment commands, the characters to align by are simply have their repeating duplicates removed if there are any.
General - These items apply to all commands unless explicitly stated otherwise.
First Occurrence - Aligns the selected lines using whitespace so the provided character or characters line up vertically including one space prior. When using on a single line, any whitespace before or after the first instance of the provided characters will be removed. Lines that don't contain the provided character or characters are skipped except to conform the indentation.
Each Occurrence - Aligns the selected lines using whitespace so that each instance of the provided character or characters are the furthest to the right they need to be to make the first character after the one or ones provided line up vertically. Lines that don't contain the provided character or characters are skipped except to conform the indentation. If a line has less than the maximum number of instances, only the matching number of items are aligned for that specific line.
Loading More data ...