Skip to main content
remove comment re python as that is Sublime 3
Source Link
mmmmmm
  • 31k
  • 18
  • 94
  • 158

You can easily add the Applications directory to your PATH but it will not do anything useful as it is a collection of OSX apps which are bundles and can't be run from the command line.

There are several alternatives

  1. Use the open command which will open any OSX app e.g. open -a Sublime\ Text.app source.php This works for all apps
  2. Find the unix executable in the app bundle usually in Contents/MacOS and with a similar name to the app. In Sublime this looks like sublime.py a python file
  3. Some apps e.g. Sublime provide a specific command line tool and use that. This is what is suggested in Sublime's documentation However I would just create an alias to the full path "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" and use the full path in the EDITOR environment variable

You can easily add the Applications directory to your PATH but it will not do anything useful as it is a collection of OSX apps which are bundles and can't be run from the command line.

There are several alternatives

  1. Use the open command which will open any OSX app e.g. open -a Sublime\ Text.app source.php This works for all apps
  2. Find the unix executable in the app bundle usually in Contents/MacOS and with a similar name to the app. In Sublime this looks like sublime.py a python file
  3. Some apps e.g. Sublime provide a specific command line tool and use that. This is what is suggested in Sublime's documentation However I would just create an alias to the full path "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" and use the full path in the EDITOR environment variable

You can easily add the Applications directory to your PATH but it will not do anything useful as it is a collection of OSX apps which are bundles and can't be run from the command line.

There are several alternatives

  1. Use the open command which will open any OSX app e.g. open -a Sublime\ Text.app source.php This works for all apps
  2. Find the unix executable in the app bundle usually in Contents/MacOS and with a similar name to the app.
  3. Some apps e.g. Sublime provide a specific command line tool and use that. This is what is suggested in Sublime's documentation However I would just create an alias to the full path "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" and use the full path in the EDITOR environment variable
edited body
Source Link
nohillside
  • 104.5k
  • 42
  • 222
  • 275

You can easily add the Applications directory to your PATH but it will not do anything useful as it is a collection of OSX apps which are bundles and can't be run from the command line.

There are several alternatives

  1. Use the open command which will p[en annopen any OSX app e.g. open -a Sublime\ Text.app source.php This works for all apps
  2. Find the unix executable in the app bundle usually in Contents/MacOS and with a similar name to the app. In Sublime this looks like sublime.py a python file
  3. Some apps e.g. Sublime provide a specific command line tool and use that. This is what is suggested in Sublime's documentation However I would just create an alias to the full path "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" and use the full path in the EDITOR environment variable

You can easily add the Applications directory to your PATH but it will not do anything useful as it is a collection of OSX apps which are bundles and can't be run from the command line.

There are several alternatives

  1. Use the open command which will p[en ann OSX app e.g. open -a Sublime\ Text.app source.php This works for all apps
  2. Find the unix executable in the app bundle usually in Contents/MacOS and with a similar name to the app. In Sublime this looks like sublime.py a python file
  3. Some apps e.g. Sublime provide a specific command line tool and use that. This is what is suggested in Sublime's documentation However I would just create an alias to the full path "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" and use the full path in the EDITOR environment variable

You can easily add the Applications directory to your PATH but it will not do anything useful as it is a collection of OSX apps which are bundles and can't be run from the command line.

There are several alternatives

  1. Use the open command which will open any OSX app e.g. open -a Sublime\ Text.app source.php This works for all apps
  2. Find the unix executable in the app bundle usually in Contents/MacOS and with a similar name to the app. In Sublime this looks like sublime.py a python file
  3. Some apps e.g. Sublime provide a specific command line tool and use that. This is what is suggested in Sublime's documentation However I would just create an alias to the full path "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" and use the full path in the EDITOR environment variable
Source Link
mmmmmm
  • 31k
  • 18
  • 94
  • 158

You can easily add the Applications directory to your PATH but it will not do anything useful as it is a collection of OSX apps which are bundles and can't be run from the command line.

There are several alternatives

  1. Use the open command which will p[en ann OSX app e.g. open -a Sublime\ Text.app source.php This works for all apps
  2. Find the unix executable in the app bundle usually in Contents/MacOS and with a similar name to the app. In Sublime this looks like sublime.py a python file
  3. Some apps e.g. Sublime provide a specific command line tool and use that. This is what is suggested in Sublime's documentation However I would just create an alias to the full path "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" and use the full path in the EDITOR environment variable