Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How could one invoke Sublime Text from the command line, so that it starts in the current folder? (I'm using the MINGW32 that comes with Git on Windows)

share|improve this question
up vote 7 down vote accepted

One solution might be to make an alias to fire up sublime to edit a file:

alias edit='c:/Program\ Files/sublime\ text\ 2/sublime_text.exe -w'

So one can do something like:

cd c:/repos/test/
edit test.html

Sublime should open up, and after save+close it should go back to the command prompt.

share|improve this answer
Beautiful, thanks! – Dan Jun 1 '12 at 19:23
For what it's worth, on other platforms sublime includes a "subl" command to do exactly this. If you want to be consistent, you should probably use that instead of "edit". – Abhi Beckert Jun 8 '12 at 0:11
What does "-w" mean? – Hugh Lee Jan 17 '13 at 9:18
The -w means -w or --wait: Wait for the files to be closed before returning See – Pat Jul 31 '13 at 21:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .