sublime.plugin.zsh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Sublime Text 2 Aliases
  2. if [[ $('uname') == 'Linux' ]]; then
  3. local _sublime_linux_paths > /dev/null 2>&1
  4. _sublime_linux_paths=(
  5. "$HOME/bin/sublime_text"
  6. "/opt/sublime_text/sublime_text"
  7. "/usr/bin/sublime_text"
  8. "/usr/local/bin/sublime_text"
  9. "/usr/bin/subl"
  10. )
  11. for _sublime_path in $_sublime_linux_paths; do
  12. if [[ -a $_sublime_path ]]; then
  13. st_run() { $_sublime_path $@ >/dev/null 2>&1 &| }
  14. alias st=st_run
  15. break
  16. fi
  17. done
  18. elif [[ $('uname') == 'Darwin' ]]; then
  19. local _sublime_darwin_paths > /dev/null 2>&1
  20. _sublime_darwin_paths=(
  21. "/usr/local/bin/subl"
  22. "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
  23. "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
  24. "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
  25. "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
  26. "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
  27. "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
  28. )
  29. for _sublime_path in $_sublime_darwin_paths; do
  30. if [[ -a $_sublime_path ]]; then
  31. alias subl="'$_sublime_path'"
  32. alias st=subl
  33. break
  34. fi
  35. done
  36. fi
  37. alias stt='st .'