# WARNING: This file is automatically managed by ansible, any changes in it will be discarded on configuration reload
# vim: syntax=sh
#
# ~/.bashrc
#

export HISTFILESIZE=-1
export HISTSIZE=-1

export EDITOR=vim
GREEN="$(tput setaf 2)"
RED="$(tput setaf 1)"
REDB="$(tput setab 1)$(tput setaf 0)"
RESET="$(tput sgr0)"

function status {
    S=$?
    if [[ $S = 0 ]]; then
        echo ${GREEN}
    else
        echo ${REDB}
    fi
    return $S
}

shopt -s histappend
PROMPT_COMMAND='history -a'
PS1="\[${RED}\][\u@\h \w]\[\$(status)\](\$?)\$\[${RESET}\] "

alias ls='ls --color=auto'
alias ll='ls -l'
alias rm='rm -I --preserve-root'
alias s='screen'
