Sublime Text through command line: Don't open more than 1 window/instance, add to working project instead

Augustin Riedinger

It's pretty unclear the philosophy of Sublime Text (3 in my case) concerning opening program from command line.

With version 2, if I wanted to open Sublime with the current working directory I would type subl . &. With version 3, the & has become optional, the instance is automatically sent to the background.

That's good, but if there already was an instance of sublime to be restored, both window become open.

Multiple Sublime Windows

What I'd expect by running subl .

  • If an instance is already stored, it opens and adds . (working directory) to the left panel (they call it Add to the project)
  • Else do the current behavior

Is there any chance I can achieve that?

Maybe I should use what they call project, but that's pretty unnatural to me: sublime should open and close files, so only 1 window, with many folders in the left panel I can manage is the best.

Augustin Riedinger

Cool, I found it:

subl --add .

From subl --help.

I've aliased it: alias subl="subl --add"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

More than one folder / project in one Sublime Text 3 window

From Dev

Bash: more than one command line substitution

From Dev

Add Package Control in Sublime Text 3 through the command line

From Dev

Why can't I launch Sublime Text 3 with sudo from my command line?

From Dev

Open more than 1 file using with - python

From Dev

Adding project to solution through command line

From Dev

Sublime Text 2 command line not working after Mavericks install

From Dev

Command Line Window in Sublime Text

From Dev

Open a folder in Sublime Text 3 using command line

From Dev

Add files to Xcode project through command line ? Use of project.pbxproj file in Xcode?

From Dev

Android: text button disordered and cut when more than 1 line

From Dev

TFS command line not working through Jenkins

From Dev

open directory as a project from command line intellij

From Dev

Open AndroidStudio project from command line on OSX

From Dev

Console Color: more than 1 in same line?

From Dev

Lauching Sublime Text From Command Line

From Dev

Can't add more than 1 object to MongoDB collection

From Dev

Why isn't this sublime text keybind working?

From Dev

Lauching Sublime Text From Command Line

From Dev

Bash: more than one command line substitution

From Dev

Explorer open a library through command line

From Dev

Add/edit line text in file without open editor (linux command)

From Dev

Open more than 1 file using with - python

From Dev

jquery not working with more than 1 function

From Dev

Don't let me add in a listbox more items than shown in the combobox

From Dev

Append text file with command output, but replace the words that already exist (don't add the same text twice)

From Dev

Sublime Text open open relative to project directoy

From Dev

Append child can`t add more than 1 child node

From Dev

Why don't i get any results when my input variable has more than 1 character?

Related Related

  1. 1

    More than one folder / project in one Sublime Text 3 window

  2. 2

    Bash: more than one command line substitution

  3. 3

    Add Package Control in Sublime Text 3 through the command line

  4. 4

    Why can't I launch Sublime Text 3 with sudo from my command line?

  5. 5

    Open more than 1 file using with - python

  6. 6

    Adding project to solution through command line

  7. 7

    Sublime Text 2 command line not working after Mavericks install

  8. 8

    Command Line Window in Sublime Text

  9. 9

    Open a folder in Sublime Text 3 using command line

  10. 10

    Add files to Xcode project through command line ? Use of project.pbxproj file in Xcode?

  11. 11

    Android: text button disordered and cut when more than 1 line

  12. 12

    TFS command line not working through Jenkins

  13. 13

    open directory as a project from command line intellij

  14. 14

    Open AndroidStudio project from command line on OSX

  15. 15

    Console Color: more than 1 in same line?

  16. 16

    Lauching Sublime Text From Command Line

  17. 17

    Can't add more than 1 object to MongoDB collection

  18. 18

    Why isn't this sublime text keybind working?

  19. 19

    Lauching Sublime Text From Command Line

  20. 20

    Bash: more than one command line substitution

  21. 21

    Explorer open a library through command line

  22. 22

    Add/edit line text in file without open editor (linux command)

  23. 23

    Open more than 1 file using with - python

  24. 24

    jquery not working with more than 1 function

  25. 25

    Don't let me add in a listbox more items than shown in the combobox

  26. 26

    Append text file with command output, but replace the words that already exist (don't add the same text twice)

  27. 27

    Sublime Text open open relative to project directoy

  28. 28

    Append child can`t add more than 1 child node

  29. 29

    Why don't i get any results when my input variable has more than 1 character?

HotTag

Archive