Skip to content

Instantly share code, notes, and snippets.

@kanikash4
Created March 13, 2020 07:48
Show Gist options
  • Save kanikash4/0d5bf9ee27737eb5fb2099a47674aa64 to your computer and use it in GitHub Desktop.
Save kanikash4/0d5bf9ee27737eb5fb2099a47674aa64 to your computer and use it in GitHub Desktop.
Adding symlink to open sublime from terminal
Solving with the Symbolic link:
Irrespective of any version, it will help:
symbolic link and use the subl command, as $PATH and different versions within the installation folder may differ from one and other, so here is the simplest way to set up the symlink without having problem with quotation, versions, path etc.
1. Open Finder in your system, locate your Sublime Text app within the Applications folder.
2. Right click on the App, then `Show Package Contents`.
3. Navigate up to: Contents -> SharedSupport -> bin, look for subl file.
4. Copy this file subl.
5. Paste the value from clipboard into terminal, it'll give you the right path to the subl command already quoted, use this value to make the symlink as follows.
6. ln -svf {PASTE RIGHT HERE} /usr/local/bin/subl
e.g. for sublime 2:
ln -svf /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
7. Go to the folder you want to open and write subl -a .
Done!
Hope this can help others who might be facing the same problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment