Skip to content

Instantly share code, notes, and snippets.

@keyganker
Last active September 18, 2023 16:27
Show Gist options
  • Save keyganker/1c27558c31627127ed132add75696d9b to your computer and use it in GitHub Desktop.
Save keyganker/1c27558c31627127ed132add75696d9b to your computer and use it in GitHub Desktop.
我的shell配置 #shell
#终端git分支着色
function git_branch {
branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`"
if [ "${branch}" != "" ];then
if [ "${branch}" = "(no branch)" ];then
branch="(`git rev-parse --short HEAD`...)"
fi
echo " ($branch)"
fi
}
#git complete,需要去这里下载:https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
if [ -f /etc/bash_completion.d/git-completion.bash ]; then
. /etc/bash_completion.d/git-completion.bash
fi
#ls color
export CLICOLOR=1
export LSCOLORS=gxfxaxdxcxegedabagacad
#终端提示
export PS1='\u@ \[\033[32;40m\]\w\[\033[01;32m\]$(git_branch)\[\033[00m\] \$ '
#alias
source ~/.bash_aliases
#php版本管理
source ~/.phpbrew/bashrc
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment