ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Pretty Shell

by aerobounce ST3

Prettify, Minify and Syntax Check bash / posix / mksh script with Sublime Text 3

Details

Installs

  • Total 2K
  • Win 639
  • Mac 1K
  • Linux 468
Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7
Windows 3 4 3 1 4 4 5 4 2 5 4 0 0 1 3 0 1 3 1 2 3 3 2 3 6 2 2 2 3 6 5 2 4 1 2 2 1 2 2 0 1 3 1 2 3 5
Mac 3 4 1 6 5 2 7 6 9 3 1 1 2 4 7 1 0 4 1 0 2 3 2 8 2 2 2 6 5 4 7 3 3 0 7 6 4 1 6 2 4 4 1 5 5 1
Linux 1 2 6 3 0 3 3 1 4 1 2 1 6 2 2 6 4 3 2 1 1 2 1 5 2 0 1 2 3 0 0 2 1 0 5 1 2 2 1 2 1 2 2 1 0 4

Readme

Source
raw.​githubusercontent.​com

🐚 Pretty Shell

Shell Script Formatter / Syntax Checker for Sublime Text 3
For Every Shell Scripters.
Available via Package Control

🚅 Blazingly Fast Formatting / Minifying 🚦 Syntax Checking

📦 Install

  1. Package Control: Install Package
  2. Type PrettyShell and Install
  3. You're ready to script.
  4. Recommended to use SublimeLinter-shellcheck.
Manual Install “sh # 1. Clone this repository as shown below # 2. You’re ready (Restart Sublime Text if the package is not recognized) # Example on macOS (It should work on Linux / Windows too. # Follow the same steps with the equivalent clone target directory) cd ”$HOME/Library/Application Support/Sublime Text 3/Packages" git clone https://github.com/aerobounce/Sublime-Pretty-Shell.git “Pretty Shell” “

⚠️ Dependency

Pretty Shell does not work without shfmt as this package utilizes the formatter.
It is available via several package managers, and in pre-built binary form.

If Sublime Text does not recognize shfmt, specify the absolute path in the settings:

"shfmt_bin_path": "Absolute Path to shfmt"

📝 Available Commands

Caption Command Default Key Bindings
Pretty Shell: Format pretty_shell cmd or alt + ctrl + s
Pretty Shell: Format Selection pretty_shell_selection None
Pretty Shell: Minify pretty_shell_minify None
Pretty Shell: Minify Selection pretty_shell_minify_selection None
  • Command is the name of the command you can use for Key-Bindings.
  • Be aware that any manual modifications with Format Selection commands might be lost upon saving a file if format_on_save is true, which it is by default.

🛠 Default Settings

/* Pretty Shell */
"format_selection_only": false, // Entire file will be used if no selection available
"format_on_save": true,         // Invoke "Pretty Shell: Format" command on save
"shfmt_bin_path": "shfmt",

/* shfmt */
"simplify": true,   // Simplify the code
"minify": false,    // Minify the code to reduce its size (implies "simplify")
"language": "bash", // Language variant to parse (bash / posix / mksh)
"indent": 4,        // 0 for tabs
"binop": false,     // Binary operators such as '&&' and '|' may start a line
"switchcase": true, // Indent switch cases
"rediop": true,     // Redirect operators will be followed by a space
"align": false,     // Keep column alignment paddings
"fnbrace": false    // Place function opening braces on a separate line

🤝 Thank you