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

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

☑️ Todo

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

🤝 Thank you