-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
175 lines (141 loc) · 4.63 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
#printf '\n%.0s' {1..100} # send prompt to bottom of the terminal
# Path to your oh-my-zsh installation.
export ZSH="${HOME}/.oh-my-zsh"
export IS_DOCKER=$(awk -F/ '$2 == "docker"' /proc/self/cgroup)
unsetopt nomatch
setopt inc_append_history
setopt share_history
# Set zsh theme
ZSH_THEME="powerlevel10k/powerlevel10k"
## Powerlevel10K configs
# VPN
POWERLEVEL9K_VPN_IP_FOREGROUND="green"
POWERLEVEL9K_VPN_IP_BACKGROUND="black"
POWERLEVEL9K_VPN_IP_INTERFACE="tun.*|tap.*"
POWERLEVEL9K_VPN_IP_SHOW_ALL=true
POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION=''
# Context
POWERLEVEL9K_CONTEXT_TEMPLATE="`[ -n "$IS_DOCKER" ] && echo docker \~\ $(hostname) || [ -n "$SSH_CONNECTION" ] && echo ssh \~\ $(hostname)`"
# Root
POWERLEVEL9K_ROOT_INDICATOR_BACKGROUND="red"
POWERLEVEL9K_ROOT_INDICATOR_FOREGROUND="white"
POWERLEVEL9K_ROOT_ICON='%B#'
#Prompt
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context root_indicator dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(vpn_ip virtualenv background_jobs)
if [ "$IS_DOCKER" ] ; then
POWERLEVEL9K_DISABLE_GITSTATUS=true
fi
# tmux plugin settings
if [ -n "$SSH_CONNECTION" ] || [ -n "$IS_DOCKER" ] ; then
export ZSH_TMUX_AUTOCONNECT="false"
export ZSH_TMUX_AUTOSTART="false"
else
export ZSH_TMUX_AUTOCONNECT="true"
export ZSH_TMUX_AUTOSTART="true"
fi
export ZSH_TMUX_AUTOQUIT="false"
# zsh syntax highlighting
# Declare the variable
typeset -A ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[path]='none'
ZSH_HIGHLIGHT_STYLES[precommand]='fg=green'
# Uncomment the following line to disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"
apt_pref="apt"
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
tmux
zsh-syntax-highlighting
docker
python
debian
encode64
colored-man-pages
sudo
)
source $ZSH/oh-my-zsh.sh
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
#
#
source ~/dotfiles/aliases.zsh
# rshell variables
export RSHELL_PORT="/dev/ttyUSB0"
# PATH variables
export GOPATH=$HOME/go
export GOROOT=/usr/local/go
export GOBIN=$HOME/bin
export PATH=$HOME/.local/bin:$PATH
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin:$GOBIN
export PATH=$PATH:/opt/jdk-11.0.9+11/bin
export PATH=$PATH:$HOME/.gem/ruby/2.7.0/bin
export PATH=$PATH:$HOME/.ipi/bin
# functions
jadx-gui () {
nohup jadx-gui $1 &>/dev/null &
}
burp () {
nohup ~/burp_suite/burp.sh &>/dev/null &
}
if [ -n "$SSH_CONNECTION" ] || [ -n "$IS_DOCKER" ]
then
echo ""
else
if [ -d ~/.axiom ]; then
source ~/dotfiles/axiom.zsh
fi
fi
shell() {
if [[ $1 ]]; then
port=$1
else
port=9000
fi
stty raw -echo;
(
echo "export TERM=xterm";
echo 'python -c "import pty;pty.spawn(\"/bin/bash\")" 2>/dev/null || \
python3 -c "import pty;pty.spawn(\"/bin/bash\")" 2>/dev/null || \
script -qc /bin/bash /dev/null 2>/dev/null';
echo "stty$(stty -a | awk -F ';' '{print $2 $3}' | head -n 1)";
echo reset; cat) | nc -lvnp $port && reset
}
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/opt/google-cloud-sdk/path.zsh.inc' ]; then . '/opt/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/opt/google-cloud-sdk/completion.zsh.inc' ]; then . '/opt/google-cloud-sdk/completion.zsh.inc'; fi
PATH="/home/${HOME}/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/${HOME}/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/${HOME}/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/${HOME}/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/${HOME}/perl5"; export PERL_MM_OPT;