-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathdot.zshrc
171 lines (140 loc) · 6.91 KB
/
dot.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
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/<YOUR_USER>/.oh-my-zsh
export LC_ALL=en_US.UTF-8
export PATH="/usr/local/opt/terraform@0.12/bin:$PATH"
#source /Users/<YOUR_USER>/awesome-terminal-fonts/build/*.sh
#zstyle ':completion:*:*:git:*' script ~/.oh-my-zsh/custom/plugins/git-completion.bash
#fpath=(~/.oh-my-zsh/custom/plugins $fpath)
plugins=(zsh-autosuggestions fast-syntax-highlighting git)
autoload -Uz compinit && compinit
#source ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
#source ~/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh
ZSH_THEME="powerlevel10k/powerlevel10k"
POWERLEVEL9K_MODE='nerdfont-complete'
ENABLE_CORRECTION="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
PATH=$PATH:~/Library/Python/2.7/bin
export PATH="$HOME/Library/Python/3.8/bin:$PATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
DEFAULT_USER="sudhindra sajjal"
POWERLEVEL9K_CUSTOM_WIFI_SIGNAL="zsh_wifi_signal"
POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_BACKGROUND="green"
POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_FOREGROUND="black"
zsh_wifi_signal(){
local output=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I)
local airport=$(echo $output | grep 'AirPort' | awk -F': ' '{print $2}')
if [ "$airport" = "Off" ]; then
local color='%F{black}'
echo -n "%{$color%}Wifi Off"
else
local ssid=$(echo $output | grep ' SSID' | awk -F': ' '{print $2}')
local speed=$(echo $output | grep 'lastTxRate' | awk -F': ' '{print $2}')
local color='%F{black}'
[[ $speed -gt 100 ]] && color='%F{black}'
[[ $speed -lt 50 ]] && color='%F{red}'
echo -n "%{$color%}$ssid %{$color%}\uf1eb %{%f%}" # removed char not in my PowerLine font
fi
}
POWERLEVEL9K_CONTEXT_TEMPLATE='sudhindra'
POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND='white'
POWERLEVEL9K_BATTERY_CHARGING='yellow'
POWERLEVEL9K_BATTERY_CHARGED='green'
POWERLEVEL9K_BATTERY_DISCONNECTED='$DEFAULT_COLOR'
POWERLEVEL9K_BATTERY_LOW_THRESHOLD='10'
POWERLEVEL9K_BATTERY_LOW_COLOR='red'
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=''
#POWERLEVEL9K_BATTERY_STAGES=($'\u2581 ' $'\u2582 ' $'\u2583 ' $'\u2584 ' $'\u2585 ' $'\u2586 ' $'\u2587 ' $'\u2588 ')
POWERLEVEL9K_BATTERY_ICON='\uf1e6 '
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
#POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="❱ "
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{014}\u2570%F{cyan}\uF054%F{073}\uF054%F{109}\uF054%f "
POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='yellow'
POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='yellow'
POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context battery dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time dir_writable custom_wifi_signal kubecontext ram load background_jobs)
#POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
POWERLEVEL9K_TIME_FORMAT="%D{\uf017 %H:%M \uf073 %d/%m/%y}"
POWERLEVEL9K_TIME_BACKGROUND='white'
POWERLEVEL9K_RAM_BACKGROUND='yellow'
POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND="white"
POWERLEVEL9K_LOAD_WARNING_BACKGROUND="white"
POWERLEVEL9K_LOAD_NORMAL_BACKGROUND="white"
POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND="red"
POWERLEVEL9K_LOAD_WARNING_FOREGROUND="yellow"
POWERLEVEL9K_LOAD_NORMAL_FOREGROUND="black"
POWERLEVEL9K_LOAD_CRITICAL_VISUAL_IDENTIFIER_COLOR="red"
POWERLEVEL9K_LOAD_WARNING_VISUAL_IDENTIFIER_COLOR="yellow"
POWERLEVEL9K_LOAD_NORMAL_VISUAL_IDENTIFIER_COLOR="green"
POWERLEVEL9K_HOME_ICON=''
POWERLEVEL9K_HOME_SUB_ICON=''
POWERLEVEL9K_FOLDER_ICON=''
POWERLEVEL9K_STATUS_VERBOSE=true
POWERLEVEL9K_STATUS_CROSS=true
POWERLEVEL9K_TIME_ICON=""
POWERLEVEL9K_PUBLIC_IP_BACKGROUND="green"
POWERLEVEL9K_PUBLIC_IP_FOREGROUND="black"
POWERLEVEL9K_KUBECONTEXT_BACKGROUND="white"
POWERLEVEL9K_KUBECONTEXT_FOREGROUND="black"
# Alias
alias cls="clear"
alias down="cd ~/Downloads"
alias ..="cd .."
alias ....="cd ../.."
alias look="find * -type f | fzf > selected"
alias search="grep --color -rnw ./ -e "
alias ports="lsof -PiTCP -sTCP:LISTEN"
alias gc="git -c http.sslVerify=false clone"
alias git="git -c http.sslVerify=false"
alias gch="git checkout"
alias gpr="git pull --rebase"
alias gpo="git push origin"
alias graph="git log --color --graph --pretty=format:\"%h | %ad | %an | %s%d\" --date=short"
alias hist="git log --color --pretty=format:\"%C(yellow)%h%C(reset) %s%C(bold red)%d%C(reset) %C(green)%ad%C(reset) %C(blue)[%an]%C(reset)\" --relative-date --decorate"
alias xclip="xclip -selection c"
alias ms="/opt/metasploit-framework/bin/msfconsole"
alias speedtest="curl -o /dev/null cachefly.cachefly.net/100mb.test"
alias hollywood="docker run -it jturpin/hollywood hollywood"
export LSCOLORS=""
DISABLE_MAGIC_FUNCTIONS=true
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
### Fix slowness of pastes
# Kubernetes aliases
alias kubectx="/Users/<YOUR_USER>/temedica/scripts/kubectx"
alias k="kubectl"
# Added by serverless binary installer
export PATH="$HOME/.serverless/bin:$PATH"
export VAULT_ADDR="https://vault.temedica.com"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
source ~/.oh-my-zsh/custom/plugins/istio-completions/_istioctl
alias code="/Applications/Visual\ Studio\ Code\ 2.app/contents/Resources/app/bin/code"
export PATH=/opt/homebrew/bin:/Users/<YOUR_USER>/.serverless/bin:/Users/<YOUR_USER>/Library/Python/3.8/bin:/usr/local/opt/terraform@0.12/bin:/Users/<YOUR_USER>/.serverless/bin:/Users/<YOUR_USER>/Library/Python/3.8/bin:/usr/local/opt/terraform@0.12/bin:/Users/<YOUR_USER>/.serverless/bin:/Users/<YOUR_USER>/Library/Python/3.8/bin:/usr/local/opt/terraform@0.12/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/<YOUR_USER>/Library/Python/2.7/bin:/usr/local/opt/fzf/bin:/Users/<YOUR_USER>/Library/Python/2.7/bin:/Users/<YOUR_USER>/Library/Python/2.7/bin
# tabtab source for packages
# uninstall by removing these lines
[[ -f ~/.config/tabtab/__tabtab.zsh ]] && . ~/.config/tabtab/__tabtab.zsh || true
# NodeJS
alias node16='export PATH="/usr/local/opt/node@16/bin:$PATH"'
alias node14='export PATH="/usr/local/opt/node@14/bin:$PATH"'
export PATH="/usr/local/opt/libpq/bin:$PATH"