sublime.plugin.zsh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. st_run_sudo() {sudo $_sublime_path $@ >/dev/null 2>&1}
  15. alias sst=st_run_sudo
  16. alias st=st_run
  17. break
  18. fi
  19. done
  20. elif [[ "$OSTYPE" = darwin* ]]; then
  21. local _sublime_darwin_paths > /dev/null 2>&1
  22. _sublime_darwin_paths=(
  23. "/usr/local/bin/subl"
  24. "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
  25. "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
  26. "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
  27. "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
  28. "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
  29. "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
  30. )
  31. for _sublime_path in $_sublime_darwin_paths; do
  32. if [[ -a $_sublime_path ]]; then
  33. alias subl="'$_sublime_path'"
  34. alias st=subl
  35. break
  36. fi
  37. done
  38. fi
  39. alias stt='st .'