# If not running interactively, don't do anything
[[ $- != *i* ]] && return

if [ "$PWD" != "$HOME" ] && [ "$PWD" -ef "$HOME" ] ; then cd ; fi
if [ -d "/usr$HOME" ] ; then export HOME=/usr$HOME ; cd ; fi

for BASHRC in /etc/bashrc /etc/bash.bashrc /etc/bash/bashrc ; do
  if [ -f "$BASHRC" ] ; then
    . "$BASHRC"
  fi
done
unset BASHRC

EDITOR=nvim; export EDITOR

if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
    PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH

# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
  for rc in ~/.bashrc.d/*; do
    if [ -f "$rc" ]; then
      . "$rc"
    fi
  done
fi

unset rc