export ANDROID_HOME=~/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
#Git-cli highlight
export PS1="\u@\h:\w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "

## functions start
function git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "("${ref#refs/heads/}") ";
}

function git_since_last_commit {
now=`date +%s`;
last_commit=$(git log --pretty=format:%at -1 2> /dev/null) || return;
seconds_since_last_commit=$((now-last_commit));
minutes_since_last_commit=$((seconds_since_last_commit/60));
hours_since_last_commit=$((minutes_since_last_commit/60));
minutes_since_last_commit=$((minutes_since_last_commit%60));

echo "${hours_since_last_commit}h${minutes_since_last_commit}m ";
}

#列出当前目录
function tree
{
if [[ $1 ]]; then
find . -maxdepth $1 -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
else
find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
fi
}

ws() { open -a WebStorm ${1-'.'}; } # 用指定的编辑器编辑当前文件或者指定的文件\
psm() { open -a PhpStorm ${1-'.'}; } # 用PhpStorm打开指定文件夹

PS1="\u:\W \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\$(git_since_last_commit)\[\033[0m\]\$ "

### functions end

### Aliases
alias subl=\''/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'\'
alias ls='ls -G'
alias ll='ls -alh'

 

转载于:https://www.cnblogs.com/haigelang/p/8138273.html

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐