shell插件subline_SublimeText3shell脚本⽂件格式化插件
Pret。。。
这⼏天疯狂写脚本,突然发现⼀直没有shell格式化插件,实在太影响效率了,给⼤家推荐这款插件,使⽤⾮常简单,保存⽂件的同时⾃动格式化,⽆需其他操作。
shell最简单脚本并且会及时提⽰语法错误位置!
安装插件
command+shift+P
输⼊ install 选中 install
输⼊ prettyshell 选择安装插件
在Mac平台插件需要依赖shfmt程序,程序通过 Homebrew 安装。Homebrew 官⽅源链接是越来越难了,推荐⼤家⽤阿⾥的镜像源。
镜像源修改⽅法:
#替换 .git 仓库地址
cd "$(brew --repo)"
#替换 homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
brew update
#安装 shfmt
安装过程有提⽰权限错误,根据提⽰修改既可完成安装。
brew install shfmt
Error: The following directories are not writable by your user:
/usr/local/share/man/man8
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/man/man8
And make sure that your user has write permission.
chmod u+w /usr/local/share/man/man8
sudo chown -R $(whoami) /usr/local/share/man/man8
Password:
chmod u+w /usr/local/share/man/man8
brew install shfmt
>>>>>>>>>>>>>>## 100.0%
==> Pouring shfmt-3.1.2.catalina.
/usr/local/Cellar/shfmt/3.1.2: 6 files, 3.2MB
现在可以畅快的写脚本了~ 等不忙了,我会把这个插件也集成到便携版中。
shell 字符运算
« 上一篇
shell编程电子书
下一篇 »

发表评论