# /.bashrc /.bash_profile  - common file
#
# Test for an interactive shell.  There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
	# Shell is non-interactive.  Be done now!
	return
fi

export VISUAL="/usr/bin/vim"
export EDITOR="$VISUAL"

export PATH=$HOME/bin:$HOME/.local/bin
export PS1='\[\033[01;32m\]\t-\u@\h \[\033[01;36m\]\w \$\[\033[00m\] '

export HISTFILE=~/.bash_history
export HISTFILESIZE=4000000
export HISTSIZE=64000
export HISTCONTROL=ignoreboth:erasedups
export HISTTIMEFORMAT="%F %T "
shopt -s checkwinsize
shopt -s histappend                      # append to history, don't overwrite it
# Save and reload the history after each command finishes
#export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"

#export PYTHONSTARTUP=$HOME/.pystartup

# source custom config
if [ -d "$HOME/.bashrc.d" ]; then
    # Use a loop to source all files in the directory
    for file in "$HOME/.bashrc.d/"*.sh; do
        # Check if the file exists and is readable before sourcing
        if [ -f "$file" ] && [ -r "$file" ]; then
            . "$file" # The '.' command is a synonym for 'source'
        fi
    done
fi
