0

As the name suggested. I would like to have something like:

sublime ./My_project/my_example.cpp

Then it opens the my_example.cpp in SublimeText for me.

4 Answers 4

1

Everything is explained here.

Basically you just need to create a symbolic link (ln -s) somewhere in your path and make it point to the "subl" (not "sublime") executable.

Sign up to request clarification or add additional context in comments.

Comments

1

Sublime text includes a command line script subl but you'll need to link it into your /usr/local/bin

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

(and you may need sudo)

Comments

0

I'm not sure what SublimeText is, but if it is an app bundle you can do:

$ open -a SublimeText.app ./My_project/my_example.cpp

You can do a few other things if you really want it to be exactly the syntax you suggested:

$ alias sublime='open -a SublimeText.app'

enter that in a terminal, or add it to your ~/.profile.

Comments

0

If you install Sublime Text 3 via homebrew (cask, as explained here) then it will create sublime symlink for you automatically.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.