Enable autocd in bash shell if it's supported

main
Buddy Sandidge 4 years ago
parent 534dc78750
commit b52ea6723f

@ -26,6 +26,8 @@ export HISTSIZE=
export HISTFILESIZE= export HISTFILESIZE=
export HISTTIMEFORMAT='%y-%m-%d %T λ ' export HISTTIMEFORMAT='%y-%m-%d %T λ '
export RIPGREP_CONFIG_PATH="${XDG_CONFIG_HOME}/ripgrep/config"
# make less more friendly for non-text input files, see lesspipe(1) # make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

@ -2,12 +2,18 @@
[ -z "$PS1" ] && return [ -z "$PS1" ] && return
function source-file { function source-file {
local file
file="$1" file="$1"
if [[ -f "$file" ]]; then if [[ -f "$file" ]]; then
# shellcheck disable=SC1090
source "$file" source "$file"
fi fi
} }
if [[ ! "${BASH_VERSION}" = "3.2*" ]]; then
shopt -s autocd
fi
source-file /etc/bash_completion source-file /etc/bash_completion
source-file ~/.bash/environment source-file ~/.bash/environment
source-file ~/.bash/colors source-file ~/.bash/colors
@ -15,7 +21,7 @@ source-file ~/.bash/aliases
source-file ~/.bash/functions source-file ~/.bash/functions
source-file ~/.bash/path source-file ~/.bash/path
source-file ~/.bash/prompt source-file ~/.bash/prompt
source-file ~/.bash/ensure-ssh-agent #source-file ~/.bash/ensure-ssh-agent
source-file ~/.bash/completion source-file ~/.bash/completion
source-file ~/opt/bash/env source-file ~/opt/bash/env
source-file ~/go/bin source-file ~/go/bin

@ -0,0 +1 @@
--colors=line:fg:black

@ -10,6 +10,13 @@ export XDG_CACHE_HOME=${XDG_CACHE_HOME:="$HOME/.cache"}
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:="$HOME/.config"} export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:="$HOME/.config"}
export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"} export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"}
[[ -f $XDG_CONFIG_HOME/user-dirs.dirs ]] && eval $( [[ -f "${XDG_CONFIG_HOME}/user-dirs.dirs" ]] && eval "$(
cat $XDG_CONFIG_HOME/user-dirs.dirs | awk '/^XDG_/ {print "export " $1}') awk '/^XDG_/ {print "export " $1}' "${XDG_CONFIG_HOME}/user-dirs.dirs"
[[ -f $HOME/.bashrc ]] && source $HOME/.bashrc )"
if [[ ${SHELL} = /bin/bash ]] || [[ ${SHELL} = /usr/local/bin/bash ]]; then
# shellcheck disable=SC1090
if [[ -f "${HOME}/.bashrc" ]]; then
source "${HOME}/.bashrc"
fi
fi

Loading…
Cancel
Save