sublime.plugin.zsh 842 Bytes
Newer Older
Dylan Hudson's avatar
Dylan Hudson committed
1
# Sublime Text 2 Aliases
2

3
local _sublime_darwin_paths > /dev/null 2>&1
4
_sublime_darwin_paths=(
5
	"/usr/local/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 2.app/Contents/SharedSupport/bin/subl"
9
	"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
10
)
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
19
	alias st=st_run

20
elif  [[ $('uname') == 'Darwin' ]]; then
21
22
23

	for _sublime_path in $_sublime_darwin_paths; do
		if [[ -a $_sublime_path ]]; then
24
25
			alias subl="'$_sublime_path'"
			alias st=subl
26
			break
27
28
		fi
	done
29
fi
30

Dylan Hudson's avatar
Dylan Hudson committed
31
alias stt='st .'