diff --git a/.bashrc b/.bashrc index ccbf129..0664896 100644 --- a/.bashrc +++ b/.bashrc @@ -1,6 +1,7 @@ # 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 if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi @@ -8,9 +9,13 @@ if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi [[ -f /etc/bash.bashrc ]] && . /etc/bash.bashrc || true [[ -f /etc/bash_completion ]] && . /etc/bash_completion || true [[ -r /etc/bash/bashrc ]] && . /etc/bash/bashrc || true -[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" +[[ -r "/usr/local/share/bash-completion/bash_completion" ]] && . "/usr/local/share/bash-completion/bash_completion" +if [[ -d "/usr/local/etc/bash_completion.d" ]] ; then + for i in /usr/local/etc/bash_completion.d/*.sh ; do + source "$i" + done +fi [[ -r "/usr/share/bash-completion/bash_completion" ]] && . "/usr/share/bash-completion/bash_completion" -[[ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]] && . $HOME/.nix-profile/etc/profile.d/nix.sh || true [[ -e $HOME/.local/bin/git-prompt.sh ]] && . $HOME/.local/bin/git-prompt.sh || true alias dotfiles='git --git-dir=$HOME/dev/dotfiles.git/ --work-tree=$HOME'