Without this change, whether a function can invoke 'subl' depends on the order in which modules are loaded. With this change, the order doesn't matter.
zsh resolves aliases at parse time not run time, which means if you invoke an alias from a function, the alias must be defined before the function.
See http://stackoverflow.com/a/25532276/893113 which refers to an explanation of this limitation.
For code which may be used non-interactively, the recommend workaround is to use functions instead of aliases.
- Fixed subl search path order in Mac because Sublime Text 3 is named
Sublime Text.app by default instead of Sublime Text 3.app and they are
mostly likely to be placed in /Applications instead of
$HOME/Applications.
- Fixed sublime text binary path in Linux. The sublime_text binary
installed by Ubuntu installer is placed in /opt/sublime_text/sublime_text
instead of /usr/bin/sublime_text.
- Use zsh's built-in process detach syntax instead of nohup.
User changed symbolic link for sublime binary is now top priority,
since this allows users to actually specify which version of sublime
they want to use. Sublime text 2 binary has higher priority over
sublime text (3) binary, since sublime text 2 is considered more
stable.
Detects the platform using "uname", and sets the alias accordingly.
If you are using Linux, this assumes that you have created a
symbolic link to /usr/bin/sublime_text.