#set -x # Print out all of the commands that are executing. # If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac cd ~ # Unbreak broken, non-colored terminal. export TERM=xterm-256color color_prompt=yes # Load the shell environment. test -f ~/.env.loader && . ~/.env.loader # TMP and TEMP are defined in the Windows environment. Leaving them set to the default # Windows temporary directory can have unexpected consequences. export TMP=/tmp export TEMP=/tmp export TMPDIR=/tmp # Customize the shell prompt. in_git_work_tree() { git rev-parse --is-inside-work-tree &> /dev/null } parse_git_branch() { if in_git_work_tree; then git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' fi } export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] -> \w\[\033[33m\]\n$(parse_git_branch)\[\033[0;32m\]\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] ' # Git autocompletion. if [ -f ~/.git-completion.bash ]; then . ~/.git-completion.bash # Git autocompletion fixes for bash aliases __git_complete g __git_main __git_complete gco _git_checkout __git_complete gl _git_branch __git_complete gll _git_branch __git_complete gsh _git_branch __git_complete gbd _git_branch __git_complete gpo _git_branch __git_complete grb _git_branch __git_complete gm _git_merge __git_complete gmff _git_merge __git_complete gmnff _git_merge fi # Don't use ^D to exit. set -o ignoreeof # Don't put duplicate lines or lines starting with space in the history. See bash(1) for more options. HISTCONTROL=ignoreboth # Append to the history file. shopt -s histappend # Customize history. HISTSIZE=20000 HISTFILESIZE=20000 HISTIGNORE="&:ls:l:ll:[bf]g:less:clear:cls:exit:history:hist" HISTTIMEFORMAT='%F %T ' # Check the window size after each command and, if necessary, update the values of LINES and COLUMNS. shopt -s checkwinsize # Make `less` more friendly for non-text input files, see lesspipe(1). [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # Colored GCC warnings and errors. export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' # Enable color support in ls. if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" fi # Enable programmable completion features (you don't need to enable # this if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi # Enable direnv if it exists. if [ -x $GOPATH/bin/direnv.exe ]; then eval "$(direnv.exe hook bash)" fi