參考:http://www.reibang.com/p/484e5be21786
vscode版本:1.26.0 (在此版本上安裝)
下載地址:https://github.com/mvdan/sh/releases(下載64位的)
目前最新版本:
https://github.com/mvdan/sh/releases/download/v2.5.1/shfmt_v2.5.1_windows_amd64.exe
在vscode的安裝目錄建立tools_plugins(安裝其他第三方插件),將?shfmt?放入此目錄
D:\Program Files\Microsoft VS Code\tools_plugins\shfmt_v2.5.1_windows_amd64.exe
插件啟用設置:文件 → 選項 ?→?設置?→? shellf ( 輸入shellf )??→ ?修改配置項
修改后保存
需要格式化的內容先慷,右鍵 → 格式化文件(會將整個編輯窗口的內容都格式化)