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 595
  • Win 166
  • Mac 293
  • Linux 136
Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 29 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23
Windows 1 3 2 2 1 1 1 1 5 2 1 2 2 5 6 2 5 1 0 4 5 7 7 2 2 1 6 2 2 8 1 0 1 0 2 3 1 0 2 0 5 3 0 2 5 2
Mac 3 6 4 3 0 6 6 5 7 2 2 2 5 4 2 6 0 4 2 2 5 9 5 2 1 4 3 4 7 6 2 1 3 9 4 6 4 6 2 1 2 0 6 5 8 1
Linux 0 0 2 0 2 1 0 2 4 6 2 0 2 3 5 5 4 1 2 2 1 1 2 1 0 2 1 4 4 1 1 1 1 1 1 4 0 0 1 1 1 1 1 0 4 1

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.
Manual Install “bash # 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) git clone https://github.com/aerobounce/Sublime-Pretty-Shell.git ”$HOME/Library/Application Support/Sublime Text 3/Packages/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

// shfmt settings
"simplify": true,   // Simplify the code
"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
"minify": false,    // Minify program to reduce its size

// Pretty Shell settings
"format_selection_only": false, // Entire file will be used if no selections
"format_on_save": true,
"shfmt_bin_path": "shfmt"

☑️ Todo

  • [ ] Real-time formatting / syntax checking for fun?

🤝 Thank you