2691520d6f84fd0022fcb82a497042bb92c777b7
- Author
- Kaiwen Xu <kevin@kevxu.net>
- Committer
- Kaiwen Xu <kevin@kevxu.net>
- Date
Message
Integrate changes from #1841.
Diff
1diff --git a/plugins/sublime/sublime.plugin.zsh b/plugins/sublime/sublime.plugin.zsh
2index 6ca5892e5d0053b112c001685ac13c3d22a53aee..a2042343a478cc84f91ab8b2c98c7d2204b4d5c7 100755
3--- a/plugins/sublime/sublime.plugin.zsh
4+++ b/plugins/sublime/sublime.plugin.zsh
5@@ -1,25 +1,32 @@
6 # Sublime Text 2 Aliases
7
8-local _sublime_darwin_paths > /dev/null 2>&1
9-_sublime_darwin_paths=(
10- "/usr/local/bin/subl"
11- "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
12- "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
13- "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
14- "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
15- "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
16- "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
17-)
18-
19 if [[ $('uname') == 'Linux' ]]; then
20- if [ -f '/opt/sublime_text/sublime_text' ]; then
21- st_run() { /opt/sublime_text/sublime_text $@ &| }
22- else
23- st_run() { /usr/bin/sublime-text $@ &| }
24- fi
25- alias st=st_run
26+ local _sublime_linux_paths > /dev/null 2>&1
27+ _sublime_linux_paths=(
28+ "$HOME/bin/sublime_text"
29+ "/opt/sublime_text/sublime_text"
30+ "/usr/bin/sublime_text"
31+ "/usr/local/bin/sublime_text"
32+ )
33+ for _sublime_path in $_sublime_linux_paths; do
34+ if [[ -a $_sublime_path ]]; then
35+ st_run() { $_sublime_path $@ >/dev/null 2>&1 &| }
36+ alias st=st_run
37+ break
38+ fi
39+ done
40
41 elif [[ $('uname') == 'Darwin' ]]; then
42+ local _sublime_darwin_paths > /dev/null 2>&1
43+ _sublime_darwin_paths=(
44+ "/usr/local/bin/subl"
45+ "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
46+ "/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
47+ "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
48+ "$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
49+ "$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
50+ "$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
51+ )
52
53 for _sublime_path in $_sublime_darwin_paths; do
54 if [[ -a $_sublime_path ]]; then