blackberrysetr.blogg.se

Start sublime text from command line
Start sublime text from command line








Important Note: The specific package in your question implements a load_session command, which prompts you for the session to load from a list of sessions you've previously created.

#START SUBLIME TEXT FROM COMMAND LINE HOW TO#

If you want to run this command in response to double clicking a file of a particular type (here a simplesession file), how you do that is specific to the operating system and file browser that you're using, and is best asked as a separate question.Īssuming you instead want a level of integration where you just have a desktop shortcut, start menu entry, etc that does this, this is more straight forward because such a shortcut is really just a visual wrapper that executes a command of your choosing.Īgain, how you would do that is different depending on your OS, but the important part is knowing what full command line you need to give to the shortcut to be able to run it, which is what this answer tells you how to construct. This answer will give you the information that you need to formulate the command line that you need to execute in order to get the plugin command to run and carry out the action that you desire. In core Sublime you can do this by executing the subl program that ships with Sublime and tell it a plugin command that you would like to execute.Īlthough it's possible to do this, the solution provided here has the requirement that Sublime already be running due to technical limitations within Sublime itself, but more on that in a moment. If you want to take the action from outside of Sublime, then you need to communicate that command to Sublime in order to get it to execute.

start sublime text from command line

To do that from within Sublime you'd do something like bind a keyboard key to the appropriate command, add it to a menu, the command palette, etc. Here that would be a command in the plugin that created the file in question, which would tell it that you want to carry out the action you would normally take manually, such as loading a session. So what you really need is the way to tell the plugin to take the action for you.Īll actions in Sublime (including things as simple as inserting text) are taken by executing a command. Since it's a plugin that created the file, that plugin is the only thing that knows that it's special and what to do with it. Sublime doesn't know that a simplesession file is important in any way, so double clicking on one is going to open it the same as Sublime would open any other file.








Start sublime text from command line