5

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)

1 Answer 1

7
+50

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.

3
  • 2
    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". Jun 8, 2012 at 0:11
  • What does "-w" mean? Jan 17, 2013 at 9:18
  • The -w means -w or --wait: Wait for the files to be closed before returning See sublimetext.com/docs/2/osx_command_line.html
    – Pat
    Jul 31, 2013 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.