Shell Script beautifier plugin for Sublime Text 3.
Recommended for shell scripting beginners.
I've written this plugin for myself to learn how to write scripts in correct syntax.
Highly recommended to use this plugin with:
Make sure you have installed
shfmt as this package utilizes the formatter.
If you are on macOS, you can install it with Homebrew:
brew install shfmt
If installed via
brew and your shell recognize its path, that's it.
Otherwise, install the command in a way whatever you like, then specify full path to the bin in setting:
"shfmt_bin_path": "FULL PATH to shfmt"
Package Control: Install Package
- You're ready
Install (Manually on macOS / Linux / Windows)
- Quit Sublime Text
- Clone this repository as shown below
- You're ready
git clone https://github.com/aerobounce/Sublime-Pretty-Shell.git "$HOME/Library/Application Support/Sublime Text 3/Packages/PrettyShell"
- It should work on Linux / Windows too. Follow the same steps with the equivalent clone target directory.
Pretty Shell: Format
or just save script file you are editing while
Default Key Binding
- macOS: cmd + ctrl + s
- Linux: alt + ctrl + s
- Windows: alt + ctrl + s
"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_on_save": true, "shfmt_bin_path": "shfmt"
- Show parsing errors
- Format only selection