-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zshrc
309 lines (246 loc) · 8.9 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#!/usr/bin/zsh
# ██████▓██ ██▓ █ ██ █████
#▒██ ▒ ▒██ ██▒ ██ ▓██▒▒██▓ ██▒
#░ ▓██▄ ▒██ ██░▓██ ▒██░▒██▒ ██░
# ▒ ██▒ ░ ▐██▓░▓▓█ ░██░░██ █▀ ░
#▒██████▒▒ ░ ██▒▓░▒▒█████▓ ░▒███▒█▄
#▒ ▒▓▒ ▒ ░ ██▒▒▒ ░▒▓▒ ▒ ▒ ░░ ▒▒░ ▒
#░ ░▒ ░ ░▓██ ░▒░ ░░▒░ ░ ░ ░ ▒░ ░
#░ ░ ░ ▒ ▒ ░░ ░░░ ░ ░ ░ ░
# ░ ░ ░ ░ ░
# ░ ░
bold=$(tput bold)
normal=$(tput sgr0)
GREEN='\033[1;32m'
YELLOW='\033[1;30m'
BLUE='\033[0;33m'
NC='\033[0m' # No Color
function ordinal () {
case "$1" in
*1[0-9] | *[04-9]) echo "$1"th;;
*1) echo "$1"st;;
*2) echo "$1"nd;;
*3) echo "$1"rd;;
esac
}
if [ $(date +%j) = 256 ]; then
echo "CODING DAY 🐧"
fi
# week
printf "Current week is: %i\n" "$(date +"%V")" | lolcat
echo "$(ordinal ${GREEN}${bold}$(date +%j)) ${YELLOW}day"
if [[ "$(pidof zsh | wc -w)" = "3" ]]; then
cal -3
fi
# cal -3
if [[ -n ${DISPLAY:+set} ]] && whence xrdb >/dev/null; then
if xrdb -query | grep -q '^pietrodito\.session\.ran-fortune:.*true'; then
cal -3
xrdb -merge <<<'pietrodito.session.ran-fortune: true'
fi
fi
# [[ $(pidof zsh | wc -w) == 3 ]] && cal -3
# [[ "$(pidof zsh)" == *' '* ]] || cal -3
echo "${normal}🌴"
# echo ${(%):-'%F{yellow}%B%b%f'}
echo "${Blue}${bold}$(sb-clock)"
# 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="/home/tat/.oh-my-zsh"
# ZSH_THEME="dracula"
# DRACULA_DISPLAY_CONTEXT=1
# export KEYTIMEOUT=1
# VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true
# VI_MODE_SET_CURSOR=true
# Case-sensitive completion must be off. _ and - will be interchangeable.
CASE_SENSITIVE=true
HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
DISABLE_MAGIC_FUNCTIONS="false"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
# Random themes
ZSH_THEME=random
# ZSH_THEME="" # Pure Pretty, minimal and fast ZSH prompt
# ZSH_THEME_RANDOM_CANDIDATES=(dracula starship robbyrussell af-magic ys cloud
# bira dst bureau gnzh linuxonly kardan josh refined)
ZSH_THEME_RANDOM_CANDIDATES=(dracula starship)
ZSH_THEME_RANDOM_QUIET=true
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
COMPLETION_WAITING_DOTS="true"
# COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
plugins=(
sudo
urltools
web-search
# vi-mode
ripgrep
node
nvm
command-not-found
colored-man-pages
emotty
pass
# emoji-clock
man
fzf
copypath
# thefuck
# ssh-agent
copyfile
emoji
# starship
zoxide
# Clone local
fzf-tab
forgit
zsh-syntax-highlighting
history-substring-search
zsh-autosuggestions
git-flow-completion
)
# .zshrc pure settings
# fpath+=($HOME/.zsh/pure)
# autoload -U promptinit; promptinit
# prompt pure
# zmodload zsh/nearcolor
# zstyle :prompt:pure:path color '#FF0000'
# zstyle :prompt:pure:git:stash show yes
# ssh-agent IMPORTANT: put these settings before the line that sources oh-my-zsh
# zstyle :omz:plugins:ssh-agent agent-forwarding yes
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
source $ZSH/oh-my-zsh.sh
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#000000,bold"
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
zstyle ':omz:update' frequency 7
# Call `nvm use` automatically in a directory with a `.nvmrc` file
autoload -U add-zsh-hook
load-nvmrc() {
if nvm -v &> /dev/null; then
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use --silent
fi
elif [ "$node_version" != "$(nvm version default)" ]; then
nvm use default --silent
fi
fi
}
type -a nvm > /dev/null && add-zsh-hook chpwd load-nvmrc
type -a nvm > /dev/null && load-nvmrc
#zsh syntax highlighting dracula
#source /home/tat/.oh-my-zsh/custom/themes/dracu-syntax-highlighting.zsh
# source /home/tat/.oh-my-zsh/custom/themes/zsh-syntax-highlighting/zsh-syntax-highlighting.sh
# Nerd fonts icon
source ~/.local/share/fonts/i_oct.sh
# env
source $XDG_CONFIG_HOME/zsh/.zshenv
# eval "$(starship init zsh)"
eval $(thefuck --alias)
# eval "$(zoxide init zsh)"
eval "$(navi widget zsh)"
eval "$(atuin init zsh --disable-ctrl-r)"
eval "$(lesspipe.sh)"
eval "$(fnm env --use-on-cd)"
eval "$(leetcode completions)"
eval "$(mcfly init zsh)"
eval "$(plow --completion-script-zsh)"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='fd --type f --strip-cwd-prefix --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# set -gx FZF_ALT_C_COMMAND "xclip -selection clipboard"
# . ~/.oh-my-zsh/custom/plugins/z/z.sh
# Rainbows and unicorns!
# fortune | cowsay | lolcat
# if [ -x /usr/bin/cowsay -a -x /usr/bin/fortune ]; then
# fortune | cowsay
# fi
if [[ -n ${DISPLAY:+set} ]] && whence xrdb >/dev/null; then
if xrdb -query | grep -q '^pietrodito\.session\.ran-fortune:.*true'; then
fortune | cowsay | lolcat
xrdb -merge <<<'pietrodito.session.ran-fortune: true'
fi
fi
[[ "$(pidof zsh)" == *' '* ]] || {
fortune | cowsay | lolcat }
# Displays current time
# emoji-clock
# bun completions
[ -s "/home/tat/.bun/_bun" ] && source "/home/tat/.bun/_bun"
# Bun
export BUN_INSTALL="/home/tat/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
#Broot
source /home/tat/.config/broot/launcher/bash/br
# ChatGPT nvim
source ~/.env_chatgpt.nvim
# Load Angular CLI autocompletion.
source <(ng completion script)
# nvm
# source /usr/share/nvm/init-nvm.sh
# buildpacks
. $(pack completion --shell zsh)
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/tat/Templates/test/test/google-cloud-sdk/path.zsh.inc' ]; then . '/home/tat/Templates/test/test/google-cloud-sdk/path.zsh.inc'; fi
[[ "$(pidof zsh)" == *' '* ]] || random_emoji fruits
# git-fuzzy
export PATH="/home/tat/.oh-my-zsh/custom/plugins/git-fuzzy/bin:$PATH"
# Bind zsh-history-substring-search
bindkey '^[[5~' history-substring-search-up
bindkey '^[[6~' history-substring-search-down
# fzf-tab
export GF_BAT_STYLE=changes
export GF_BAT_THEME=zenburn
# disable sort when completing `git checkout`
zstyle ':completion:*:git-checkout:*' sort false
# set descriptions format to enable group support
zstyle ':completion:*:descriptions' format '[%d]'
# set list-colors to enable filename colorizing
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# preview directory's content with exa when completing cd
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
# switch group using `,` and `.`
zstyle ':fzf-tab:*' switch-group ',' '.'
# pass
compdef _pass workpass
zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass"
workpass() {
PASSWORD_STORE_DIR=$HOME/work/pass pass $@
}
trap 'cowsay "Have a nice day!"; sleep 1' EXIT
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# load homebrew
[ -d /home/linuxbrew/.linuxbrew ] && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
#Coin
# coinmon -f shib
if type clipcat-menu >/dev/null 2>&1; then
alias clipedit=' clipcat-menu --finder=builtin edit'
alias clipdel=' clipcat-menu --finder=builtin remove'
bindkey -s '^\' "^Q clipcat-menu --finder=builtin insert ^J"
bindkey -s '^]' "^Q clipcat-menu --finder=builtin remove ^J"
fi
# random tip from this document (parses Markdown and extracts an item)
taocl | lolcat
PATH=~/.console-ninja/.bin:$PATH
[ -s "/home/tat/.scm_breeze/scm_breeze.sh" ] && source "/home/tat/.scm_breeze/scm_breeze.sh"
# alias
source $HOME/.aliases