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

更新时间:2020-01-27 05:55:37

Browse

Pretty Shell

by aerobounce ST3 MacLinux

Prettify or Minify bash / posix / mksh script with Sublime Text 3

Details

Installs

  • Total 73
  • Win 0
  • Mac 56
  • Linux 17
Jan 26 Jan 25 Jan 24 Jan 23 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
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 1 2 1 3 3 5 3 1 1 3 4 5 4 10 1 1 3 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 1 1 2 1 2 0 0 0 2 0 1 1 1 0 1 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

🐚 Pretty Shell

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:

Install

  1. Package Control: Install Package
  2. Type PrettyShell and Install
  3. You're ready

Install (Manually on macOS / Linux / Windows)

  1. Quit Sublime Text
  2. Clone this repository as shown below
  3. 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.

Dependency

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"

Usage

  1. Command Palette...
  2. Pretty Shell: Format

or just save script file you are editing while pretty_on_save is true.

Key Binding

Default Key Binding

  • macOS: cmd + ctrl + s
  • Linux: alt + ctrl + s
  • Windows: alt + ctrl + s

Options

"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"

Todo

  • [x] Show parsing errors
  • [ ] Format only selection

Special Thanks