web-dev-qa-db-fra.com

Comment puis-je ouvrir des fichiers Sublime Text 2 à partir de la ligne de commande sous Linux vers un onglet, pas une nouvelle fenêtre

J'ai la configuration ST2 pour pouvoir faire 'sublime file.txt' et cela s'ouvrira dans une fenêtre ST2. Mais comment puis-je l'ouvrir dans un nouvel onglet dans la fenêtre actuellement ouverte?

40
phirschybar

Essayez l'aide en ligne de commande 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.

Après avoir ouvert une nouvelle fenêtre, les fichiers suivants doivent y être ajoutés selon le comportement par défaut.

52
Mikko Ohtamaa

Cela fonctionne sur Ubuntu 12.04:

subl filename

ou

subl -n filename (si vous voulez qu'il s'ouvre dans une fenêtre séparée)

25
Francois
subl fileName

et si vous voulez ouvrir un nouveau fichier, utilisez

subl -n new_file_name
6
Arun Kasyakar

une autre option est: pour ouvrir le fichier.

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

ouvrir un dossier [sublime folderName]

2
Zabe Sangary