-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_profile
executable file
·112 lines (91 loc) · 2.84 KB
/
.bash_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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
export JAVA_HOME=$(/usr/libexec/java_home)
# set umask
umask 0022
EDITOR=VIM
# export EDITOR='subl -w'
CDPATH=:$HOME
export EDITOR CDPATH TERM
# History file
HISTFILE=$HOME/.bash_history
: ${HISTSIZE:=1000}
export HISTSIZE
export HISTTIMEFORMAT="%d/%m/%y %T "
################
# PATH
################
export PATH=/usr/local/bin:$PATH
export PATH=./node_modules/.bin:$PATH
################
# COLORS
################
COLOR_OFF="\[\033[0m\]"
COLOR_BLACK="\[\033[0;90m\]"
COLOR_RED="\[\033[0;31m\]"
COLOR_GREEN="\[\033[0;92m\]"
COLOR_YELLOW="\[\033[0;93m\]"
COLOR_YELLOW_DIM="\[\033[0;33m\]"
COLOR_BLUE="\[\033[0;94m\]"
COLOR_MAGENTA="\[\033[0;35m\]"
COLOR_CYAN="\[\033[0;96m\]"
COLOR_WHITE="\[\033[0;97m\]"
COLOR_WHITE_DIM="\[\033[0;37m\]"
################
# PROMPT
################
# pull in __git_ps1
for f in /usr/local/etc/bash_completion.d/* ; do source $f; done
# git is aliased to g, need to alias autocompletion
__git_complete g __git_main
# unstaged (*) and staged(+) changes
export GIT_PS1_SHOWDIRTYSTATE="1"
# whether there are stashed ($) changes
export GIT_PS1_SHOWSTASHSTATE="1"
# if there are untracked (%) files
export GIT_PS1_SHOWUNTRACKEDFILES="1"
# if we're ahead (>) or behind (<) or diverged (<>) relative to upstream
export GIT_PS1_SHOWUPSTREAM="auto"
# color hints only work for PROMPT_COMMAND, not PS1, still trying to figure that out
export GIT_PS1_SHOWCOLORHINTS="true"
# build prompt
TIME_12H="\T "
PATH_SHORT="\w "
MONEY_PROMPT=' $ '
export PS1=$COLOR_WHITE_DIM$TIME_12H$COLOR_YELLOW$PATH_SHORT'$(git branch &>/dev/null;\
if [ $? -eq 0 ]; then \
echo "$(echo `git status` | grep "nothing to commit" > /dev/null 2>&1; \
if [ "$?" -eq "0" ]; then \
echo "'$COLOR_BLUE'"; \
else \
echo "'$COLOR_MAGENTA'"; \
fi)$(__git_ps1 "(%s)")"; \
fi)'$COLOR_OFF$MONEY_PROMPT
################
# CORE ALIASES
################
# Quicker navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias mv="mv -i $*" # ask user before clobbering file
alias rm="rm -i $*" # ask user before clobbering file
alias cp="cp -i $*" # ask user before clobbering file
alias ls="ls -hFG" # add colors for filetype recognition
alias ll="ls -al" # show hidden files
alias lx="ls -lXB" # sort by extension
alias lk="ls -lSr" # sort by size, biggest last
alias lc="ls -ltcr" # sort by and show change time, recent last
alias lt="ls -ltr" # sort by date, recent last
alias lm="ls -al |more" # pipe through 'more'
alias lr="ls -lR" # recursive ls
alias g="git" # faster git!
################
# OSX CATALINA
################
# Hide "The default interactive shell is now zsh."
export BASH_SILENCE_DEPRECATION_WARNING=1
################
# ADDITIONAL FILES
################
# now pull in additional files
for f in ~/.bash.d/* ; do source $f; done