selectify READMEFeaturesCrude way to modify selected code in the editor according to rulesets. Set the rulesets by going to Code -> Preferences -> Settings -> Extensions -> Selectify. Each ruleset is an object in the rulesets array. A ruleset contains matchers--all of which much be satisfied before the actions apply. All matchers are matched on a "contains" basis, so you don't need the full line to create a matcher. If all matchers are found in a selection, the actions are performed. Remove actions get rid of lines that contain the matchers in the "remove" array, as seen below. In the above example, any lines of code containing "font-size: $font-size-medium" and "font-weight: $font-weight-medium" will be removed. Add actions add the line(s) of code to the 2nd line in the selection. YOU MUST SELECT THE CODE ACCORDINGLY. Here's an example of ruleset settings:
So if your selection is:
The above rulesets will results in:
Note the lack of formatting (run Prettier after execution) How to mess this up Add actions literally add what you say to the 2nd line in the selected text. It's crude, it has no clue it's even working with CSS, I literally do a string.split("\n") to parse the text and insert the added line at splitString[1] Selecting anything outside of the CSS rule will mess this up. If your selection is:
The above rulesets will results in:
|