2012-09-01 38 views
37

我有ST2設置,因此我可以'sublime file.txt',它會在ST2窗口中打開。但是,如何在當前打開的窗口的新選項卡中打開它?如何從Linux的命令行打開Sublime Text 2文件到選項卡,而不是新窗口

+1

在我安裝它會打開一個新的選項卡中的文件。你是如何安裝SublimeText2的? –

+1

我把tarball抽取到/ usr/lib /製作符號鏈接到它:sudo ln -s/usr/lib/Sublime \ Text \ 2/sublime_text/usr/bin/sublime – phirschybar

回答

47

嘗試崇高的命令行幫助

subl --help 崇高文本2建造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. 

你已經打開了新的窗口後面的文件應加有按默認行爲之後。

+0

根據[this userecho](http: //sublimetext.userecho.com/topic/87972-allow-editing-stdin-on-linux/)以及我自己對同一版本的體驗,指定'stdin'作爲文件只是OS X的一個選項。 –

+0

我是不知道我是否理解這個問題與編輯stdin有關? –

+0

道歉Mikko,早些時候我在尋找關於爲什麼我的構建沒有stdin選項的信息。發現後,我瀏覽了一堆搜索結果標籤,試圖留下有用的信息。不應該在這裏留下任何東西:) –

22

這工作在Ubuntu 12.04:

subl filename 

subl -n filename(如果你希望它在一個單獨的窗口中打開)

2

另一種選擇是: 打開文件。

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

打開文件夾[崇高FOLDERNAME]

3
subl fileName 

,如果你想打開一個新的文件使用

subl -n new_file_name 
相關問題