bash - Sublime Text 2 - OS X 命令行

标签 bash terminal sublimetext2

原始 Sublime 2 instruction使编辑器能够从命令行启动:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

不要在 Mountain Lion 工作。

最佳答案

如果 ~/bin 目录不存在,则创建它:

mkdir ~/bin

然后再次运行ln。通过将此添加到 ~/.bashrc 文件,确保该目录已添加到您的 $PATH 中,如果不存在则创建它:

export PATH="$PATH:~/bin"

如果您不使用 bash,请使用您的手册​​了解如何将目录添加到您的 $PATH 变量。

其实说明书上是这么说的:

The first task is to make a symlink to subl. Assuming you've placed Sublime Text 2 in the Applications folder, and that you have a ~/bin directory in your path, you can run: [snip]

这意味着您需要创建 ~/bin 目录(如果它不存在),如果它不存在则将其添加到您的 $PATH 中。上面的说明正是这样做的。

如果你不喜欢你漂亮的主文件夹中那个丑陋的 bin 文件夹,你可以使用 chflags 让它从 Finder 中消失:

chflags hidden ~/bin

关于bash - Sublime Text 2 - OS X 命令行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13655343/

相关文章:

c - 在终端上运行 c 源代码会产生奇怪的输出

php - Sublime text 2 中像 Dreamweaver 一样的默认页面设置?

bash——基于特定列的两个文件的交集?

bash:将脚本的输出作为脚本执行

terminal - --递归错误: Insufficient Permission: Request had insufficient authentication scopes

C++程序在代码块中编译运行,但无法在终端中编译

ruby - Bash - 如何从后台 ruby​​ 脚本获取 STDOUT

通过 bash 调用 C 程序并提供两个输入

sass - SublimeText是否不允许摘要中包含$ variables?

keyboard-shortcuts - Sublime Text : how to make shortcut for inserting text?