课程表

Sublime Text 3课程

工具箱
速查手册

Sublime Text OS X命令行

当前位置:免费教程 » 软件/图像 » Sublime Text 3

Sublime Text包括命令行工具,subl,用于在命令行上处理文件。这可以用在Sublime Text中打开文件和项目,以及用于unix工具的编辑器,例如git和subversion。


建立


第一个任务是建立一个符号链接到subl。假设你在应用程序文件夹中放置了Sublime Text,并且在路径中有一个〜/ bin目录,则可以运行:
  1. ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl

用法


运行subl --help,
  1. Usage: subl [arguments] [files] edit the given files
  2. or: subl [arguments] [directories] open the given directories
  3. or: subl [arguments] - edit stdin
  4. Arguments:
  5. --project <project>: Load the given project
  6. --command <command>: Run the given command
  7. -n or --new-window: Open a new window
  8. -a or --add: Add folders to the current window
  9. -w or --wait: Wait for the files to be closed before returning
  10. -b or --background: Don't activate the application
  11. -s or --stay: Keep the application activated after closing the file
  12. -h or --help: Show help (this message) and exit
  13. -v or --version: Show version and exit
  14. --wait is implied if reading from stdin. Use --stay to not switch back
  15. to the terminal when a file is closed (only relevant if waiting for a file).
  16. Filenames may be given a :line or :line:column suffix to open at a specific
  17. location.

编辑

要使用Sublime Text作为许多提示输入的命令的编辑器,请设置EDITOR环境变量:
  1. export EDITOR='subl -w'
指定-w将导致subl命令在文件关闭之前不退出。
转载本站内容时,请务必注明来自W3xue,违者必究。
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号