I just launched a new course on ES6! Use the code WESBOS for $10 off.

Strengthen your core JavaScript skills and master all that ES6 has to offer. Start Now →

Sublime Text subl command line access on windows

If you are a terminal or command line power user, you often want to open in from Sublime Text right from the cmd line. Often something like this:

subl style.css

On OSX and Linux, we have the subl command that comes with Sublime Text, to install it you can follow the instructions here.

However, on windows we need to do it a little different by creating something called a doskey.

So, if you wish to use the subl command to open files and folders from the command line in windows, you can use the following:

doskey subl="C:\Program Files\Sublime Text 2\sublime_text.exe" $*

Paste the above into your command line prompt and this will make the subl command available to you.

If you are using Sublime Text 3, use the following instead:

doskey subl="C:\Program Files\Sublime Text\sublime_text.exe" $*

This entry was posted in Sublime Text. Bookmark the permalink.

4 Responses to Sublime Text subl command line access on windows

  1. Wesley says:

    Hey, namesake!

    I’ve found it’s lacking a “3”, in the Sublime text 3 directory. Worked for me just in that way.

    Thanks!

  2. rick says:

    hmm my git bash wash installed but ruby installer so i see not Git folder. i downloaded gitbash for windows so now i have a git folder inserted the txt to bin folder and still not working.

  3. Is it me or it doesn’t work on windows with bash or cygwin or anything else than the CMD

  4. Dunsin says:

    cool! worked for me. But just as Wesley said, a “3” is lacking. So if your sublime version is 3 and you installed it in “/Program Files”, use:
    doskey subl=”C:\Program Files\Sublime Text 3\sublime_text.exe” $*

Leave a Reply

Your email address will not be published. Required fields are marked *