Open a folder in Sublime Text 3 using command line

前端 未结 10 1468
旧巷少年郎
旧巷少年郎 2020-12-23 01:53

I\'m trying to open a directory in sublime Text 3.

I can launch sublime from the command line using the subl command.

The help text show the fol

相关标签:
10条回答
  • 2020-12-23 02:47

    To open sublime in the same folder you can simply type in your commandline:

    subl . 
    

    In order to work you must configure some stuff:

    1) To prevent the opening of previous projects you should set the following properties of your Sublime User Settings:

    "hot_exit": false,
    "remember_open_files": false
    

    2) In order to use subl.exe from anywhere you should add the Sublime folder in the environment variables. I.e. C:\Program Files\Sublime Text 3

    0 讨论(0)
  • 2020-12-23 02:47

    I was having trouble opening sublime text 3 with sublime text 2 currently installed. To fix this issue:

    1) open /usr/local/bin from terminal.

    2) locate and delete subl within bin folder

    3) copy and pasted '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl' /usr/local/bin/subl into terminal.

    4) locate new subl within bin folder

    5) used subl in terminal to verify command opens sublime text 3 properly.

    6) used subl -v and got Sublime Text Build 3083

    0 讨论(0)
  • 2020-12-23 02:49

    For Linux and MacOs users and Sublime Text 3 Try the command : subl3

    0 讨论(0)
  • 2020-12-23 02:52

    I've had this issue before, on both Mac OSX and Windows, and I found some oddities with it;

    Mac OSX You either have to have Sublime Text open already for the subl ./folder_name command to actually open the folder, or Sublime must have been quit with windows still open - if you close all the windows then quit Sublime, using the subl ./folder_name command will just open a blank Sublime window.

    Windows You have to have Sublime open for the subl ./folder_name to work. Without Sublime open, it will just open a blank Sublime window.

    I've yet to find a way of the command opening fine, no matter how you quit Sublime / when you have Sublime closed.

    Try having Sublime open whilst you run the command, and see if it works then.

    0 讨论(0)
提交回复
热议问题