Merge branch 'master' into git-improved

This commit is contained in:
Frank Gruellich 2014-09-04 15:30:52 +02:00
commit ee13a42106
4 changed files with 7 additions and 7 deletions

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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(){