sublime.plugin.zsh 823 B

123456789101112131415161718192021222324252627282930
  1. # Sublime Text 2 Aliases
  2. local _sublime_darwin_paths > /dev/null 2>&1
  3. _sublime_darwin_paths=(
  4. "/usr/local/bin/subl"
  5. "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
  6. "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
  7. "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
  8. "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
  9. )
  10. if [[ $('uname') == 'Linux' ]]; then
  11. if [ -f '/usr/bin/sublime_text' ]; then
  12. st_run() { nohup /usr/bin/sublime_text $@ > /dev/null & }
  13. else
  14. st_run() { nohup /usr/bin/sublime-text $@ > /dev/null & }
  15. fi
  16. alias st=st_run
  17. elif [[ $('uname') == 'Darwin' ]]; then
  18. for _sublime_path in $_sublime_darwin_paths; do
  19. if [[ -a $_sublime_path ]]; then
  20. alias st="'$_sublime_path'"
  21. break
  22. fi
  23. done
  24. fi
  25. alias stt='st .'