# PS1
# 用户名与色彩配置
export PS1='\[\033[01;33m\]\u@\h\[\033[01;31m\] \W\$\[\033[00m\] '
# for grep
alias grep='grep --color'
alias egrep='egrep --color'
alias fgrep='fgrep --color'
#alias ll='ls -alF'
#alias la='ls -A'
#alias l='ls -CF'
export CLICOLOR=1
export LSCOLORS=gxfxaxdxcxegedabagacad
alias ls='ls -G'
alias ll='ls -alF'
alias lh='ls -alFh'
# 使用brew的自动补全,安装补全的命令如下
# bash auto completion
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# mark,书签, 目录跳转,必须有呀
export MARKPATH=$HOME/.marks
function go {
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}
function mark {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}
function unmark {
rm -i "$MARKPATH/$1"
}
function marks {
ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- && echo
}
_completemarks() {
local curw=${COMP_WORDS[COMP_CWORD]}
local wordlist=$(find $MARKPATH -type l -exec basename {} \;)
COMPREPLY=($(compgen -W '${wordlist[@]}' -- "$curw"))
return 0
}
complete -F _completemarks go unmark
# for git
# git source https://github.com/git/git.git
source ${HOME}/dev_tool/git/contrib/completion/git-completion.bash
alias g='git'
alias gst='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gl='git pull'
alias gup='git pull --rebase'
alias gp='git push'
alias gd='git diff'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gca='git commit -v -a'
alias gca!='git commit -v -a --amend'
alias gcmsg='git commit -m'
alias gco='git checkout'
alias gcm='git checkout master'
alias gr='git remote'
alias grv='git remote -v'
alias grmv='git remote rename'
alias grrm='git remote remove'
alias grset='git remote set-url'
alias grup='git remote update'
alias grbi='git rebase -i'
alias grbc='git rebase --continue'
alias grba='git rebase --abort'
alias gb='git branch'
alias gba='git branch -a'
alias gcount='git shortlog -sn'
alias gcl='git config --list'
alias gcp='git cherry-pick'
alias glg='git log --stat --max-count=10'
alias glgg='git log --graph --max-count=10'
alias glgga='git log --graph --decorate --all'
alias glo='git log --oneline'
alias gss='git status -s'
alias ga='git add'
alias gm='git merge'
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'
alias gclean='git reset --hard && git clean -dfx'
alias gwc='git whatchanged -p --abbrev-commit --pretty=medium'
# for android-sdk env
ANDROID_AVD_HOME=${HOME}/.android/avd
export ANDROID_AVD_HOME
ANDROID_SDK_HOME=/Users/luogw/Library/Android/sdk
# build.xml需要 ANDROID_HOME的变量,如果没有local.properties文件的时候
ANDROID_HOME=${ANDROID_SDK_HOME}
export ANDROID_HOME
PATH=$PATH:$ANDROID_SDK_HOME/tools:$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/build-tools/27.0.3
export ANDROID_SDK_HOME
# for android completion
source ${HOME}/dev_tool/tool_script/android-complete.sh
工欲善其事,必先利其器之—提高效率的命令行环境配置汇总(.bash_profile文件的内容)
最新推荐文章于 2022-07-19 18:05:32 发布