This repository has been archived on 2021-04-14. You can view files and clone it, but cannot push or open issues/pull-requests.
bare-dotfiles/.bashrc

72 lines
2.1 KiB
Bash
Raw Normal View History

# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
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
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"
2018-07-17 17:36:50 -04:00
test -f $HOME/.bash_aliases && . $HOME/.bash_aliases || true
2020-05-27 11:24:10 -04:00
test -f $HOME/.cargo/env && . $HOME/.cargo/env || true
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi
EDITOR=vim
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
# No locking on Ctrl-S
stty -ixon
2018-07-17 09:48:02 -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
HISTSIZE=10000
2018-07-17 09:48:02 -04:00
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
# 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() {
PS1="$(powerline-go -error $?)"
2018-07-17 09:48:02 -04:00
}
2019-01-18 11:35:20 -05:00
if [[ $(which powerline-go 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
for i in $HOME/bin/*.bash ; do
. $i
done
# Set up direnv
eval "$(direnv hook bash)"