mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-06 03:10:35 +01:00
Merge branch 'master' into git-improved
This commit is contained in:
commit
ee13a42106
4 changed files with 7 additions and 7 deletions
|
|
@ -38,9 +38,9 @@ for plugin ($plugins); do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Figure out the SHORT hostname
|
# Figure out the SHORT hostname
|
||||||
if [ -n "$commands[scutil]" ]; then
|
if [[ "$OSTYPE" = darwin* ]]; then
|
||||||
# OS X
|
# OS X's $HOST changes with dhcp, etc. Use ComputerName if possible.
|
||||||
SHORT_HOST=$(scutil --get ComputerName)
|
SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
|
||||||
else
|
else
|
||||||
SHORT_HOST=${HOST/.*/}
|
SHORT_HOST=${HOST/.*/}
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -125,14 +125,12 @@ alias gsd='git svn dcommit'
|
||||||
# Usage example: git pull origin $(current_branch)
|
# Usage example: git pull origin $(current_branch)
|
||||||
#
|
#
|
||||||
function current_branch() {
|
function current_branch() {
|
||||||
if [ ! -d .git ]; then return; fi
|
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||||
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
||||||
echo ${ref#refs/heads/}
|
echo ${ref#refs/heads/}
|
||||||
}
|
}
|
||||||
|
|
||||||
function current_repository() {
|
function current_repository() {
|
||||||
if [ ! -d .git ]; then return; fi
|
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||||
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
||||||
echo $(git remote -v | cut -d':' -f 2)
|
echo $(git remote -v | cut -d':' -f 2)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Symfony2 basic command completion
|
# Symfony2 basic command completion
|
||||||
|
|
||||||
_symfony_console () {
|
_symfony_console () {
|
||||||
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console')"
|
echo "php $(find . -maxdepth 2 -mindepth 1 -name 'console' -type f | head -n 1)"
|
||||||
}
|
}
|
||||||
|
|
||||||
_symfony2_get_command_list () {
|
_symfony2_get_command_list () {
|
||||||
|
|
@ -13,6 +13,8 @@ _symfony2 () {
|
||||||
}
|
}
|
||||||
|
|
||||||
compdef _symfony2 '`_symfony_console`'
|
compdef _symfony2 '`_symfony_console`'
|
||||||
|
compdef _symfony2 'app/console'
|
||||||
|
compdef _symfony2 'bin/console'
|
||||||
compdef _symfony2 sf
|
compdef _symfony2 sf
|
||||||
|
|
||||||
#Alias
|
#Alias
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ prompt_setup_pygmalion(){
|
||||||
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||||
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||||
|
|
||||||
add-zsh-hook precmd prompt_pygmalion_precmd
|
precmd_functions+=(prompt_pygmalion_precmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt_pygmalion_precmd(){
|
prompt_pygmalion_precmd(){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue