-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
122 lines (109 loc) · 3.24 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
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
113
114
115
116
117
118
119
120
121
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
bindkey -e
cd ~/Development
alias proj='cd ~/Development'
alias gs="git status"
alias lp="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias lcc='colorls -lA --sd'
alias lca='colorls -a --sd -sf'
alias lct='colorls --tree=2'
export ZSH="/usr/local/opt/zplug/repos/robbyrussell/oh-my-zsh"
ZSH_THEME="oxide"
COMPLETION_WAITING_DOTS="true"
DISABLE_UNTRACKED_FILES_DIRTY="true"
plugins=(
git
github
node
zsh-history-substring-search
zsh-syntax-highlighting
zsh-completions
zsh-autosuggestions
command-not-found
autojump
compleat
ssh-agent
clipboard
safe-paste
)
current_user=$USER
node_version=$(node -v 2>/dev/null)
RPROMPT='%F{green}⬢ ${node_version} %F{yellow}- %F{cyan}${current_user}'
autoload -U compinit && compinit
source $ZSH/oh-my-zsh.sh
source $(dirname $(gem which colorls))/tab_complete.sh
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='nano'
else
export EDITOR='nano'
fi
##############################
# CORPORATE PROXY COMMANDS
##############################
PROXY_URL="ENTER YOUR DUMB PROXY HERE"
# Fixes any special characters used in your passwords
rawurlencode() {
local string="${1}"
local strlen=${#string}
local encoded=""
local pos c o
for (( pos=0 ; pos<strlen ; pos++ )); do
c=${string:$pos:1}
case "$c" in
[-_.~a-zA-Z0-9] ) o="${c}" ;;
* ) printf -v o '%%%02x' "'$c"
esac
encoded+="${o}"
done
echo "${encoded}"
}
proxy-on() {
echo "Enter your username:"
read USERNAME
echo "Please enter your password:"
read -s PASSWORD
PROXY="http://${USERNAME}:$(rawurlencode "$PASSWORD")@${PROXY_URL}"
export https_proxy=${PROXY}
export HTTPS_PROXY=${PROXY}
export http_proxy=${PROXY}
export HTTP_PROXY=${PROXY}
export no_proxy=${PROXY}
export NO_PROXY=${PROXY}
git config --global http.proxy ${PROXY}
git config --global https.proxy ${PROXY}
git config --global http.sslVerify "false"
git config --global url."https://".insteadOf "git://"
npm config set ca=""
# npm config set registry "SPECIAL REGISTRY GOES HERE"
npm config set strict-ssl false
npm config set proxy ${PROXY}
npm config set https-proxy ${PROXY}
echo "======================="
echo "Proxy has been set - 🛰️"
echo "======================="
}
proxy-off() {
NO_PROXY="localhost,.bullshitcorp.net,jira,complaints,whistleblowerblower"
unset https_proxy
unset HTTPS_PROXY
unset http_proxy
unset HTTP_PROXY
unset no_proxy
unset NO_PROXY
export NODE_TLS_REJECT_UNAUTHORIZED=1
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global --unset http.sslVerify "false"
git config --global --unset url."https://".insteadOf "git://"
npm config delete ca=""
# npm config set registry "SPECIAL REGISTRY GOES HERE"
npm config set strict-ssl true
npm config delete proxy ${PROXY}
npm config delete https-proxy ${PROXY}
echo "========================="
echo "Proxy has been unset - ❌"
echo "========================="
}