2020-10-30 12:06:17 -04:00
|
|
|
# If not running interactively, don't do anything
|
|
|
|
case $- in
|
|
|
|
*i*) ;;
|
|
|
|
*) return;;
|
|
|
|
esac
|
|
|
|
|
2020-12-01 14:19:14 -05:00
|
|
|
if [ -d "/usr$HOME" ] ; then export HOME=/usr$HOME ; cd ; fi
|
|
|
|
if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi
|
|
|
|
|
2018-07-17 09:48:02 -04:00
|
|
|
test -f /etc/bashrc && . /etc/bashrc || true
|
2020-05-27 11:24:10 -04:00
|
|
|
test -f /etc/bash.bashrc && . /etc/bash.bashrc || true
|
2018-11-05 16:09:02 -05:00
|
|
|
test -f /etc/bash_completion && . /etc/bash_completion || true
|
2020-01-06 11:46:03 -05:00
|
|
|
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
|
2020-05-27 11:24:10 -04:00
|
|
|
test -f $HOME/.cargo/env && . $HOME/.cargo/env || true
|
2020-10-30 12:06:17 -04:00
|
|
|
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi
|
|
|
|
|
2020-12-01 14:19:14 -05:00
|
|
|
alias dotfiles='git --git-dir=$HOME/dotfiles.git/ --work-tree=$HOME'
|
|
|
|
|
|
|
|
EDITOR=vim; export EDITOR
|
|
|
|
PAGER=less; export PAGER
|
2020-10-30 12:06:17 -04:00
|
|
|
PATH=$PATH:$HOME/.local/bin:$HOME/bin
|
|
|
|
GIT_MERGE_AUTOEDIT=no
|
|
|
|
|
|
|
|
# don't put duplicate lines or lines starting with space in the history.
|
|
|
|
# See bash(1) for more options
|
|
|
|
HISTCONTROL=ignoreboth
|
2018-07-17 09:48:02 -04:00
|
|
|
|
2020-10-30 12:06:17 -04:00
|
|
|
# No locking on Ctrl-S
|
|
|
|
stty -ixon
|
2018-07-17 09:48:02 -04:00
|
|
|
|
2020-10-30 12:06:17 -04:00
|
|
|
# check the window size after each command and, if necessary,
|
|
|
|
# update the values of LINES and COLUMNS.
|
|
|
|
shopt -s checkwinsize
|
|
|
|
|
|
|
|
# enable color support of ls and also add handy aliases
|
|
|
|
if [ -x /usr/bin/dircolors ]; then
|
|
|
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
|
|
alias ls='ls --color=auto'
|
|
|
|
|
|
|
|
alias grep='grep --color=auto'
|
|
|
|
alias fgrep='fgrep --color=auto'
|
|
|
|
alias egrep='egrep --color=auto'
|
|
|
|
fi
|
|
|
|
|
|
|
|
##
|
|
|
|
## history: http://mywiki.wooledge.org/BashFAQ/088
|
|
|
|
##
|
|
|
|
|
|
|
|
# Big history
|
2018-07-17 09:48:02 -04:00
|
|
|
HISTFILESIZE=10000
|
2020-10-30 12:06:17 -04:00
|
|
|
HISTSIZE=10000
|
2018-07-17 09:48:02 -04:00
|
|
|
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
|
|
|
|
|
2020-10-30 12:06:17 -04:00
|
|
|
# history -a causes an immediate write of all new history lines
|
|
|
|
# (instead of upon shell exit)
|
|
|
|
PROMPT_COMMAND="history -a"
|
|
|
|
|
|
|
|
# histappend which causes all new history lines to be appended, and ensures
|
|
|
|
# that multiple logins do not overwrite each other's history
|
|
|
|
shopt -s histappend
|
2018-07-17 09:48:02 -04:00
|
|
|
|
|
|
|
function _update_ps1() {
|
2020-12-01 14:19:14 -05:00
|
|
|
PS1="$(powerline-rs --modules user,host,ssh,cwd,git,gitstage,root --shell bash $?)"
|
2018-07-17 09:48:02 -04:00
|
|
|
}
|
2020-12-01 14:19:14 -05:00
|
|
|
if [[ $(which powerline-rs 2>/dev/null) && "$TERM" != "linux" && "$TERM_PROGRAM" != "vscode" ]]; then
|
2018-07-17 09:48:02 -04:00
|
|
|
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
|
|
|
|
else
|
|
|
|
PS1='[\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w$(__git_ps1 " (%s)")\[\033[00m\]]\$ '
|
|
|
|
fi
|
2020-10-30 12:06:17 -04:00
|
|
|
|
|
|
|
for i in $HOME/bin/*.bash ; do
|
|
|
|
. $i
|
|
|
|
done
|
|
|
|
|
2020-12-01 14:19:14 -05:00
|
|
|
if which lsd > /dev/null 2>&1 ; then
|
|
|
|
if [ "$TERM" = "xterm-256color" ] ; then
|
|
|
|
alias ls="lsd"
|
|
|
|
else
|
|
|
|
alias ls="lsd --icon=never"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-10-30 12:06:17 -04:00
|
|
|
# Set up direnv
|
|
|
|
eval "$(direnv hook bash)"
|