sublime.plugin.zsh 1.0 KB

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