Sublime Text 3: Using the OS X Command Line


The Problem

Welcome to “Continuous Improvement,” the podcast where we explore ways to enhance our workflow and optimize our productivity. I’m your host, Victor, and in today’s episode, we’ll be discussing a solution to a common problem faced by Sublime Text 3 users on OS X Yosemite.

Let’s dive right into it. Many Sublime Text users encounter issues with the command line tool called subl, which refuses to work after the initial installation on OS X Yosemite. This can be frustrating, especially when you rely on Sublime Text for your coding or editing needs.

Fortunately, I have a solution for you. After installing Sublime Text 3, you can create a symbolic link to resolve this issue. Here’s how you can do it. Open up your terminal and enter the following command:

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Let me break it down for you. The first path, /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl, represents the location where Sublime Text is stored in your Applications directory. The second path, /usr/local/bin, is where you want the symbolic link to reside. Once you’ve created this link, the command line tool subl should start working seamlessly.

But that’s not all. If you want to set Sublime Text as your default editor for various commands that prompt for input, follow this next step. Configure your EDITOR environment variable by entering the following command:

export EDITOR='subl -w'

The -w flag ensures that the subl command does not exit until you’ve closed the file. This is handy when you’re working on longer tasks or editing multiple files at once.

Lastly, if you’re using Git and prefer Sublime Text as your default editor for commit messages and other Git-related activities, here’s what you need to do. Use this command:

git config --global core.editor "subl -n -w"

This command sets Sublime Text as your default Git editor. The -n flag opens each file in a new window, ensuring a clutter-free editing experience. The -w flag, as we discussed before, ensures that the command doesn’t exit until you’re done editing.

And there you have it! A simple solution to get Sublime Text 3 up and running smoothly on OS X Yosemite. Don’t let technical hurdles slow you down when you’re striving for continuous improvement and peak efficiency.

That’s all for today’s episode of “Continuous Improvement.” I hope you found this information helpful for optimizing your workflow with Sublime Text 3. Be sure to tune in next time for more tips and tricks to enhance your productivity. Until then, I’m Victor, signing off.