如何从linux中的命令行打开Sublime Text 2文件到选项卡,而不是新窗口

时间:2012-09-01 04:30:23

标签: linux ubuntu sublimetext2

我有ST2设置,所以我可以做'sublime file.txt',它将在ST2窗口中打开。但是如何在当前打开的窗口中的新选项卡中打开它?

4 个答案:

答案 0 :(得分:51)

尝试使用Sublime命令行帮助

subl --help     Sublime Text 2 Build 2217

Usage: subl [arguments] [files]         edit the given files
   or: subl [arguments] [directories]   open the given directories
   or: subl [arguments] -               edit stdin

Arguments:
  --project <project>: Load the given project
  --command <command>: Run the given command
  -n or --new-window:  Open a new window
  -a or --add:         Add folders to the current window
  -w or --wait:        Wait for the files to be closed before returning
  -b or --background:  Don't activate the application
  -s or --stay:        Keep the application activated after closing the file
  -h or --help:        Show help (this message) and exit
  -v or --version:     Show version and exit

--wait is implied if reading from stdin. Use --stay to not switch back
to the terminal when a file is closed (only relevant if waiting for a file).

Filenames may be given a :line or :line:column suffix to open at a specific
location.

打开新窗口后,应按默认行为添加后续文件。

答案 1 :(得分:25)

这适用于Ubuntu 12.04:

subl filename

subl -n filename(如果您希望它在单独的窗口中打开)

答案 2 :(得分:5)

subl fileName

如果要打开新文件,请使用

subl -n new_file_name

答案 3 :(得分:2)

另一种选择是: 打开文件。

[sublime index.html script.js styles.css]

打开文件夹[sublime folderName]