1
0
Fork 0

Added Sublime Text module which checks for installed application and adds aliases.

pull/671/head
Ricard Fredin 10 years ago
parent bf9dbfd5b9
commit a31f5dd447

@ -0,0 +1,31 @@
Sublime Text
============
Checks for Sublime Text installations and adds aliases.
Port from https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/sublime
Aliases
-------
## Sublime Text
### Linux
- `st_run` - runs Sublime Text
- `st` - runs Sublime Text
- `stt` - runs Sublime Text for current directory, the same as running `st .`
### OS X
- `subl` - runs Sublime Text
- `st` - runs Sublime Text
- `stt` - runs Sublime Text for current directory, the same as running `st .`
Authors
-------
*The authors of this module should be contacted via the [issue tracker][1].*
- [Ricard Fredin](https://github.com/cordazar)
[1]: https://github.com/sorin-ionescu/prezto/issues

@ -0,0 +1,46 @@
#
# Checks for installed Sublime Text 3/2 and adds aliases
# Port from https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/sublime
#
# Authors: Ricard Fredin <ricard@opendia.se>
#
if [[ $('uname') == 'Linux' ]]; then
local _sublime_linux_paths > /dev/null 2>&1
_sublime_linux_paths=(
"$HOME/bin/sublime_text"
"/opt/sublime_text/sublime_text"
"/usr/bin/sublime_text"
"/usr/local/bin/sublime_text"
"/usr/bin/subl"
)
for _sublime_path in $_sublime_linux_paths; do
if [[ -a $_sublime_path ]]; then
st_run() { $_sublime_path $@ >/dev/null 2>&1 &| }
alias st=st_run
break
fi
done
elif [[ "$OSTYPE" = darwin* ]]; then
local _sublime_darwin_paths > /dev/null 2>&1
_sublime_darwin_paths=(
"/usr/local/bin/subl"
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
"/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
"$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
"$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
"$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
)
for _sublime_path in $_sublime_darwin_paths; do
if [[ -a $_sublime_path ]]; then
alias subl="'$_sublime_path'"
alias st=subl
break
fi
done
fi
alias stt='st .'
Loading…
Cancel
Save