-
Notifications
You must be signed in to change notification settings - Fork 0
/
.shellrc
90 lines (75 loc) · 2.9 KB
/
.shellrc
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
#-------------------------------------------------------------------------------
# OS detection
#-------------------------------------------------------------------------------
# Source: http://stackoverflow.com/questions/394230/detect-the-os-from-a-bash-script/8597411#8597411
PLATFORM='unknown'
# Linux
if [[ "$OSTYPE" == "linux-gnu" ]]; then
PLATFORM='linux'
# Mac OSX
elif [[ "$OSTYPE" == "darwin"* ]]; then
PLATFORM='osx'
# POSIX compatibility layer and Linux environment emulation for Windows
elif [[ "$OSTYPE" == "cygwin" ]]; then
PLATFORM='win'
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
elif [[ "$OSTYPE" == "msys" ]]; then
PLATFORM='win'
# I'm not sure this can happen.
elif [[ "$OSTYPE" == "win32" ]]; then
PLATFORM='win'
elif [[ "$OSTYPE" == "freebsd"* ]]; then
PLATFORM='freebsd'
fi
#-------------------------------------------------------------------------------
# Environment
#-------------------------------------------------------------------------------
export PATH=$PATH:$HOME/Applications
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH=$PATH:$HOME/.rvm/bin
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# Allows AWS Javascript SDK to load profiles from ~/.aws/config:
export AWS_SDK_LOAD_CONFIG=true
# Yarn global binaries
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
# Disable Homebrew metrics:
export HOMEBREW_NO_ANALYTICS=1
#-------------------------------------------------------------------------------
# alias
#-------------------------------------------------------------------------------
alias emacs='emacs --no-desktop --no-window-system'
alias cls='printf "\033c"'
alias gs='git status'
alias gl='git lg'
alias gsha="git rev-parse --short HEAD | tr -d '\n'"
alias ecs='ecs-cli'
if [[ ${PLATFORM} == "osx" ]]; then
alias ls='gls -ah --color=auto'
alias readlink='greadlink'
alias date='gdate'
alias gitg='gitx'
elif [[ ${PLATFORM} == "linux" ]]; then
alias ls='ls -ah --color=auto'
alias gitx='gitg'
alias rebootL='sudo grub-reboot 0; sudo reboot'
alias rebootW='sudo grub-reboot 2; sudo reboot'
if [[ $HOSTNAME = "onyx" ]]; then
alias 'nvidia'='sudo prime-select'
fi
fi
alias ag='ag --path-to-ignore ~/.ignore'
alias uuid="uuidgen | awk '{print tolower(\$0)}'"
alias dr='docker run --rm -it'
#-------------------------------------------------------------------------------
# ls colors
#-------------------------------------------------------------------------------
if [[ ${PLATFORM} == "osx" ]]; then
eval `gdircolors $HOME/.dircolors.256dark`
elif [[ ${PLATFORM} == "linux" ]]; then
eval `dircolors $HOME/.dircolors.256dark`
fi