-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
executable file
·60 lines (49 loc) · 1.38 KB
/
zshrc
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
path_append() {
ARG="$1"
if [ -d "$ARG" ] && [[ ":$PATH:" != *":$ARG:"* ]]; then
export PATH="${PATH:+"$PATH:"}$ARG"
fi
}
path_prepend() {
ARG="$1"
if [ -d "$ARG" ] && [[ ":$PATH:" != *":$ARG:"* ]]; then
export PATH="$ARG${PATH:+":$PATH"}"
fi
}
unsetopt nomatch
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
MSYS_NT*) machine=Git;;
*) machine="UNKNOWN:${unameOut}"
esac
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="agnoster"
plugins=(brew git history zsh-navigation-tools zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
if [[ "$machine" = "Mac" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ "$machine" = "Linux" ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
alias open_ports='lsof -i -P | grep -i "listen"'
alias show_path='echo "$PATH" | tr ":" "\n" | nl'
alias cgrep="grep --color=always"
export VOLTA_HOME="$HOME/.volta"
if [ -d "$VOLTA_HOME" ]; then
path_prepend $VOLTA_HOME/bin
else
echo "Run ./install to install volta"
fi
HOMEDIR_BIN="$HOME/bin"
if [ -d "$HOMEDIR_BIN" ]; then
path_append $HOMEDIR_BIN
fi
if [[ "$machine" = "Linux" ]]; then
source ~/.dotfiles/zshrc_linux
fi
# !!! Keep as last command in file !!!
[[ -f ~/.dotfiles/zshrc_local ]] && source ~/.dotfiles/zshrc_local || true