LoginSignup
0
0

More than 5 years have passed since last update.

从命令行打开sublime方法。以sublime2为例。

Posted at

参考https://segmentfault.com/q/1010000002397241

方法一

第一步:查看$PATH

echo $PATH

第二步:将sublime的link复制到$PATH中,这里我们选择/usr/local/bin/

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl
/usr/local/bin/subl

搞定。可以用subl打开文本了。

方法二

vi ~/.bash_profile。在文件的末尾添加

alias subl="open -a Sublime\ Text\ 2"

保存后执行source ~/.bash_profile,就能subl打开文本了。

总结

但是方法二有个问题,即不能用subl打开一个不存在的文件。而第一个方法可以做到。所以使用第一个方法就好。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0