# ~/.bashrc: executed by bash(1) for non-login shells.

# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

if [ -f /etc/cores.defs ]; then
    . /etc/cores.defs
	if [ -x /usr/pkg/bin/git ]; then
		if [ -f .git-completion.bash ]; then
		    . .git-completion.bash
		fi
		
		if [ -f .git-prompt.sh ]; then
		    . .git-prompt.sh
			# Configure the GIT_PS1 parameters (looks cooler! :P)
            export GIT_PS1_SHOWDIRTYSTATE=true      # staged '+', unstaged '*'
            export GIT_PS1_SHOWUNTRACKEDFILES=true  # '%' untracked files
            export GIT_PS1_SHOWUPSTREAM="auto"      # '<' behind, '>' ahead, '<>' diverged, '=' no difference
            export GIT_PS1_SHOWSTASHSTATE=true      # '$' something is stashed
            export GIT_PS1_SHOWCOLORHINTS=true
            PS1="${TVERMELHOB}|${TVERDEB}\h${TVERMELHOB}|${TAZULB}:${TROSAB}\$(__git_ps1) ${TBRANCOB}\W ${TAMARELOB}\\$ $RESET"
		fi
	else	
        PS1="${TVERMELHOB}|${TVERDEB}\h${TVERMELHOB}|${TAZULB}:${TBRANCOB}\W ${TAMARELOB}\\$ $RESET"
	fi
else
    PS1='\u@\h:\w\$ '
fi

if [ -x /usr/pkg/bin/gls ]; then
    LS_OPTIONS='--color=auto '
    alias ls='gls $LS_OPTIONS'
    alias ll='ls -lha'
    alias l='ls -lh'
fi

if [ -x /usr/pkg/bin/htop ]; then
	alias top='htop '
fi

if [ -x /usr/pkg/bin/colortail ]; then
	alias tail='colortail '
fi

if [ -x /usr/pkg/bin/vim ]; then
    alias vi='vim '
fi

if [ -r /usr/pkg/share/bash-completion/bash_completion ]; then
    . /usr/pkg/share/bash-completion/bash_completion
fi

# Aliases
alias df='df -h'
alias du='du -h '

