# If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac test -f /etc/bashrc && . /etc/bashrc || true test -f /etc/bash.bashrc && . /etc/bash.bashrc || true test -f /etc/bash_completion && . /etc/bash_completion || true [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" test -f $HOME/.bash_aliases && . $HOME/.bash_aliases || true 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 # No locking on Ctrl-S stty -ixon # 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 HISTFILESIZE=10000 HISTSIZE=10000 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 function _update_ps1() { PS1="$(powerline-go -error $?)" } if [[ $(which powerline-go 2>/dev/null) && "$TERM" != "linux" && "$TERM_PROGRAM" != "vscode" ]]; then 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)"