Created
October 30, 2017 07:12
-
-
Save radeksimko/9c78a20821a59dafc5f81cb6f35ac0bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GIT bash current branch | |
export PATH=/opt/local/bin:/usr/local/bin:/opt/local/sbin:/usr/local/sbin:$PATH | |
export GOPATH=$HOME/gopath | |
export PATH=$GOPATH/bin:$PATH # Go | |
export LANG=en_GB.UTF-8 | |
# Prompt | |
export PS1="\\u@local:\\W $ " | |
export HISTFILESIZE=5000 | |
# AWS credentials | |
[ -f ~/.aws ] && . ~/.aws | |
# Github token | |
[ -f ~/.github ] && . ~/.github | |
# Homebrew GH token | |
[ -f ~/.homebrew ] && . ~/.homebrew | |
genpasswd() { | |
local l=$1 | |
[ "$l" == "" ] && l=20 | |
head -30 /dev/random | uuencode -m - | tail -3 | head -1 | sed 's/[^A-z0-9_]/Y/g' | head -c ${l} | |
echo "" | |
} | |
if [ -f $(brew --prefix)/etc/bash_completion ]; then | |
source $(brew --prefix)/etc/bash_completion | |
fi | |
# by HABR (modified by Dundee) | |
export PSORIG="$PS1" | |
function GITBRANCH() { | |
branch="$(git branch 2>/dev/null | grep '*' | cut -d" " -f2-)" | |
dirty="$(git status -s 2>/dev/null)" | |
if [ -n "$dirty" ] ; then | |
color="1;33m" | |
else | |
color="0;33m" | |
fi | |
if [ -n "$branch" ] ; then | |
export PS1=$PSORIG$(echo -en "\[\033[$color\]$branch\[\033[0;33m\] > \[\033[00m\]") | |
else | |
export PS1="$PSORIG" | |
fi | |
} | |
PROMPT_COMMAND="GITBRANCH;" | |
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi | |
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi | |
export VAGRANT_DEFAULT_PROVIDER=virtualbox | |
export GPG_TTY=$(tty) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment