mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Merge 9ba4157e68 into 76a26a2a59
This commit is contained in:
commit
33a249a69a
1 changed files with 32 additions and 3 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
# Sublime Text 2 Aliases
|
# Sublime Text 2 Aliases
|
||||||
|
|
||||||
if [[ $('uname') == 'Linux' ]]; then
|
() {
|
||||||
local _sublime_linux_paths > /dev/null 2>&1
|
if [[ "$OSTYPE" == 'linux-gnu' ]]; then
|
||||||
|
local _sublime_linux_paths
|
||||||
_sublime_linux_paths=(
|
_sublime_linux_paths=(
|
||||||
"$HOME/bin/sublime_text"
|
"$HOME/bin/sublime_text"
|
||||||
"/opt/sublime_text/sublime_text"
|
"/opt/sublime_text/sublime_text"
|
||||||
|
|
@ -23,7 +24,7 @@ if [[ $('uname') == 'Linux' ]]; then
|
||||||
done
|
done
|
||||||
|
|
||||||
elif [[ "$OSTYPE" = darwin* ]]; then
|
elif [[ "$OSTYPE" = darwin* ]]; then
|
||||||
local _sublime_darwin_paths > /dev/null 2>&1
|
local _sublime_darwin_paths
|
||||||
_sublime_darwin_paths=(
|
_sublime_darwin_paths=(
|
||||||
"/usr/local/bin/subl"
|
"/usr/local/bin/subl"
|
||||||
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
|
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
|
||||||
|
|
@ -41,6 +42,34 @@ elif [[ "$OSTYPE" = darwin* ]]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
elif [[ "$OSTYPE" == cygwin ]]; then
|
||||||
|
local cygprogfiles=""
|
||||||
|
cygprogfiles=$(cygpath "$PROGRAMFILES")
|
||||||
|
local cygprogfiles_x86=""
|
||||||
|
cygprogfiles_x86=$(cmd /c "echo %ProgramFiles(x86)%")
|
||||||
|
cygprogfiles_x86=${cygprogfiles_x86/[\\r\\n]//}
|
||||||
|
cygprogfiles_x86=$(cygpath "$cygprogfiles_x86")
|
||||||
|
local _sublime_cygwin_paths
|
||||||
|
_sublime_cygwin_paths=(
|
||||||
|
"$cygprogfiles/Sublime Text 2/sublime_text.exe"
|
||||||
|
"$cygprogfiles/Sublime Text 3/sublime_text.exe"
|
||||||
|
"$cygprogfiles_x86/Sublime Text 2/sublime_text.exe"
|
||||||
|
"$cygprogfiles_x86/Sublime Text 3/sublime_text.exe"
|
||||||
|
)
|
||||||
|
local OLDIFS="$IFS"
|
||||||
|
IFS=$'\n'
|
||||||
|
for _sublime_path in $_sublime_cygwin_paths; do
|
||||||
|
if [[ -a $_sublime_path ]]; then
|
||||||
|
subl() { "$_sublime_path" $(cygpath -aw ${*:-.}) }
|
||||||
|
alias st=subl
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
IFS="$OLDIFS"
|
||||||
|
unset OLDIFS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
alias stt='st .'
|
alias stt='st .'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue