colonelpanic8 / multi-line

multi-line everything from function invocations and definitions to array and map literals in a wide variety of languages
57 stars 6 forks source link

RFE: Bash shell script support #14

Open PhilHudson opened 3 years ago

PhilHudson commented 3 years ago

Please consider adding out-of-the-box support for Bash shell script. It's very widely used in the Unix world.

colonelpanic8 commented 3 years ago

@PhilHudson what sorts of statements could automatically be multi-lined? I guess you are talking about inserting back slashes and multi-lining single statements?

PhilHudson commented 3 years ago

Precisely. Anything with one or more long-ish arguments.

Typically a single logical line may contain one or more levels of nested or chained sub-expressions: brace expansions, process substitions, pipelines, redirections, inline conditional branches using && and ||, etc. Individually or collectively these may take that line beyond the developer's configured line-wrap boundary, possibly multiple times.

Edge case: this minor mode should probably disable itself by default under crontab-mode and warn against being enabled, since shell commands in a crontab cannot be backslash-line-wrapped (because newlines within crontab shell commands have a special meaning and a special escape syntax using % instead of backslash).