Victor Leung
Victor Leung
BlogFlower shop

Sublime Text 3: OS X Command Line

February 20, 2015

The problem

Sublime Text 3 includes a command line tool, subl. However, it does not work out of the box after you install the editor in OS X Yosemite.

My solution

After the installation, create a symbolic link to Sublime Text using this command:

    ln -s /Applications/Sublime /usr/local/bin/subl


- ‘/Applications/Sublime’ is the location that the application is stored in your Applications directory.
- ‘/usr/local/bin’ is the chosen path you want the symbolic link to be located.

To use Sublime Text as the editor for many commands that prompt for input, set your EDITOR environment variable:

    export EDITOR='subl -w'

where the flag -w will cause the subl command not to exit until the file is closed.

You can also set your default editor in Git with this command:

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

About Victor Leung

Software development professional with expertise in application architecture, cloud solutions deployment, and financial products development. Possess a Master's degree in Computer Science and an MBA in Finance. Highly skilled in AWS (Certified Solutions Architect Professional, Developer and SysOps Administrator), GCP (Professional Cloud Architect), Microsoft Azure, Kubernetes(CKA, CKAD, CKS, KCNA), and Scrum(PSM, PSPO) methodologies.

Happy to connect

Continuous improvement

Copyright © 2023.