-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
21 lines (15 loc) · 923 Bytes
/
.bashrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Set the prompt
# Color reference: https://wiki.archlinux.org/index.php/Color_Bash_Prompt
# Mac doesn't have __git_ps1 by default: http://stackoverflow.com/questions/10435117/ps1-env-variable-does-not-work-on-mac
alias __git_ps1="git branch 2>/dev/null | grep '*' | sed 's/* \(.*\)/(\1)/'"
PROMPT_COMMAND='DIR=`pwd|sed -e "s!$HOME!~!"`; if [ ${#DIR} -gt 30 ]; then CurDir=${DIR:0:12}...${DIR:${#DIR}-15}; else CurDir=$DIR; fi'
PS1='\u\[\e[1;34m\][$CurDir] \[\e[1;32m\]$(__git_ps1)\[\e[0m\]\$ '
# History stuffs
export HISTFILE=~/.bash_history
shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
# ^ the only downside with this is [up] on the readline will go over all
# history not just this bash session.
source "$HOME/.cargo/env"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash