# .bashrc # Make a history backup since history is lost sometimes BACKUPS=~/Backups/$(date +%Y)/bash_hist/ [[ ! -d $BACKUPS ]] && mkdir -p $BACKUPS cp ~/.bash_history $BACKUPS/$(date +%s) # Load ENV file (shared with POSIX shell) [ $0 != sh ] && [ -n "${ENV:=$HOME/.env}" ] && . "$ENV" COLOR="\[$(tput setaf 3)\]" # yellow RESET="\[$(tput sgr0)\]" PS1='\[$(tput setaf 3)\]$($HOME/.local/bin/prompt)\[$(tput sgr0)\]' # Warn if .bash_profile exists (since it will prevent loading .profile) [[ -f ~/.bash_profile ]] && echo WARN: .bash_profile exists # Bash history config HISTSIZE=65535 HISTFILE=$HOME/.bash_history HISTCONTROL=ignoreboth HISTIGNORE="gst" # see man strftime HISTTIMEFORMAT="%F " # Uncomment this line and remove `histappend' to enable shared history. PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r;" #shopt -s histappend # Enable recursive search including hidden subs shopt -s globstar dotglob # See Bash manual _completion_loader() { # Completion files on Arch . "/usr/share/bash-completion/completions/$1" >/dev/null 2>&1 && return 124 } complete -D -F _completion_loader -o bashdefault -o default # Load if available [ -f ~/.fzf.bash ] && . ~/.fzf.bash [ -f ~/.config/broot/launcher/bash/br ] && . ~/.config/broot/launcher/bash/br [ -f ~/.local/src/z.sh ] && . ~/.local/src/z.sh # direnv _direnv_hook() { local previous_exit_status=$?; trap -- '' SIGINT; eval "$("/usr/bin/direnv" export bash)"; trap - SIGINT; return $previous_exit_status; }; if ! [[ "${PROMPT_COMMAND:-}" =~ _direnv_hook ]]; then PROMPT_COMMAND="_direnv_hook${PROMPT_COMMAND:+;$PROMPT_COMMAND}" fi