-
Notifications
You must be signed in to change notification settings - Fork 0
/
.profile
62 lines (47 loc) · 1.72 KB
/
.profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Customize prompt
# YYYY-MM-DD HH:MM:SS user@host ~/cwd (current-git-branch) $
function color_my_prompt {
local __user_and_host="\[\033[01;32m\]\u@\h"
local __cur_location="\[\033[01;34m\]\w"
local __git_branch_color="\[\033[31m\]"
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
local __prompt_tail="\[\033[35m\]$"
local __last_color="\[\033[00m\]"
export PS1="\n\D{%F %T} $__user_and_host $__cur_location $__git_branch_color$__git_branch$__prompt_tail$__last_color "
}
color_my_prompt
# Source secrets
source $HOME/Dropbox/dotfiles/.tokens
# Source environment local to this machine
if [[ -f $HOME/.local_env ]]; then
source $HOME/.local_env
else
echo "No local environment overrides."
fi
# Source environment related to my employer
if [[ $WORK_DIR ]] && [[ -f $WORK_DIR/.env ]]; then
source $WORK_DIR/.env
else
echo "No work dir set up on this machine or no work environment overrides."
fi
export PATH=$HOME/scripts:$HOME/bin:$HOME/go/bin:$PATH
export PATH="/usr/local/sbin:$PATH"
# Use gnu tools installed via Homebrew, unprefixed. E.g. grep instead of ggrep
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"
export EDITOR="mate -w"
export CLICOLOR="YES"
HOMEBREW_NO_ANALYTICS=1
# Avoid duplicates
export HISTCONTROL=ignoredups:erasedups
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend
HISTFILESIZE=10000000
HISTSIZE=10000000
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
export GOPATH=$HOME/go
# Aliases
alias la="ls -lah"
alias ll="ls -l"
alias l="ls"
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion