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 3K
  • Win 938
  • Mac 1K
  • Linux 627
Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8
Windows 0 3 4 4 3 2 1 4 6 4 2 7 1 0 4 5 6 4 3 1 1 2 5 3 6 4 6 0 0 5 4 0 2 0 1 3 3 3 5 7 1 3 9 3 10 3
Mac 1 9 2 2 7 4 1 6 6 2 4 6 3 3 6 4 1 5 0 1 0 2 6 5 3 2 1 4 8 4 5 4 5 2 4 3 9 4 3 6 1 1 3 5 3 10
Linux 0 1 2 0 0 1 0 3 1 2 0 1 1 4 2 2 2 1 2 4 0 3 4 0 4 3 1 1 2 2 1 0 1 2 0 4 5 0 3 3 1 2 2 2 2 2

Readme

Source
raw.​githubusercontent.​com

🐚 Pretty Shell

Shell Script Formatter / Syntax Checker for Sublime Text 3

⚡️Blazingly Fast Formatting / Minifying
❗️User Friendly Syntax Error Indication
🚦Syntax Checking


Features

  • ✨ Format on save
  • Format selection
  • Syntax errors are shown in popup with messages
    • ✨ Popup will be presented at the point error occured
  • ✨ Auto-scroll to the point where the syntax error occured

📦 Install

Available via Package Control

  1. Package Control: Install Package
  2. Type Pretty Shell and Install

Manual Install

  1. Clone this repository as shown below (Note that target directory name must be Pretty Shell)
  2. You're ready (Restart Sublime Text if the package is not recognized)
# Example on macOS — On the other platforms, follow the same steps with the equivalent path
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. Visit mvdan/sh for the latest information.
  • macOS Users
    • If your default shell does not have the path to shfmt, you need to specify it in the settings.
  • Linux / Windows Users
    • You need to specify the path to shfmt in the settings.
// Example
"shfmt_bin_path": "Absolute Path to shfmt"

📝 Available Commands

Command is the name of the command you can use for Key-Bindings.

Caption Command Default Key Bindings
Pretty Shell: Format pretty_shell (CMD / 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

🛠 Default Settings

/* Pretty Shell */
"shfmt_bin_path": "shfmt",
"format_on_save": true,
"format_selection_only": false,
"scroll_to_error_point": true,

/* shfmt (Leave these untouched to use shfmt's default behavior) */
"simplify": false,   // Simplify the code
"minify": false,     // Minify the code (implies "simplify")
"language": "",      // bash / posix / mksh (default: bash)
"indent": "",        // 0 for tabs
"binop": false,      // Operators such as '&&' and '|' may start a line
"switchcase": false, // Indent switch cases
"rediop": false,     // 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