By Chris on Code
This tutorial is out of date and no longer maintained.
Sublime Text 3 was recently updated to Build 3065. If you’re not on the bleeding edge dev builds, you won’t see updates too often. When they happen, though, there’s always some fun stuff in the update.
In this latest update, two things stood out. One is having cool icons in the sidebar next to our files, and the other is geared towards Windows users. Windows users now have a command-line helper in subl.exe
!
Mac users have had this for a long time (subl
) and it’s great to see the equivalent come to Windows.
For those of you that don’t know what it is and why it’s so great, let’s talk about how we currently add files and folders to Sublime.
The options that were available were to:
Now with the command line helper, we can add files/folders to Sublime straight from the command line!
Let’s take a look at how we can get everything set up. Go ahead and update Sublime Text to make sure you have the latest Build 3065 (Help -> Check for Updates). After the update, you may be able to go into your command line and type:
- subl.exe
- ```
-
- This should open up Sublime Text.
-
- If you get the error **command not found** then we'll need to set some things up.
-
- Adding Sublime to Your PATH
- ---------------------------
-
- The command wasn't found because Sublime Text isn't in your PATH. The things in your Windows PATH are accessible via the command line so we'll need to go ahead and add it. We will need to go into our **Environment Variables** settings. Do this by going to:
-
- **System Properties** -> **Advanced System Settings** -> **Advanced** -> **Environment Variables**
-
- A nice shortcut to do this is to open up your command line and typing `sysdm.cpl`. That will open up the window we need.
-
- **Create a New System Variable** Create a new system variable called `SUBLIME` that will point to the folder of your Sublime installation.
-
- **Add the System Variable to Your PATH** Add the following to the end of your PATH variable: `;%SUBLIME%`
-
- Now if you restart your command line (I'm using a mixture of [Git Bash and ConEmu](https://www.digitalocean.com/community/tutorials/get-a-functional-and-sleek-console-in-windows)), then you should have the `subl.exe` command at your disposal!
-
- subl.exe Into New Sublime Window
- --------------------------------
-
- You now have the ability to open a file or folder in a **new Sublime window**. Just find the one you want and type:
-
- ```command
- subl.exe file_name
- ```
-
- Or:
-
- ```command
- subl.exe folder_name
To open files or folders into the current Sublime Text window, just add the --add
modifier to your subl.exe command.
- subl.exe file_name --add
Or:
- subl.exe folder_name --add
With every version, Sublime Text just keeps getting better and better. With the addition of subl.exe
this brings a long wanted feature that was on Mac to the Windows users.
For more Sublime Text goodness, check out this article:
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.