-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathzshrc
More file actions
202 lines (163 loc) · 5.86 KB
/
zshrc
File metadata and controls
202 lines (163 loc) · 5.86 KB
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
# My 'fv' script is used to view many types of files
FILE_VIEWER=${HOME}/.bin/fv
# enable the Powerlevel10k instant prompt
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
if [[ -d /opt/homebrew/bin ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
elif [[ -d /home/linuxbrew/.linuxbrew/bin ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
#-------------------------------------------------------------------------
# clone antidote if necessary
if [[ ! -d ${ZDOTDIR:-$HOME}/.zsh_antidote ]]; then
git clone https://github.com/mattmc3/antidote ${ZDOTDIR:-$HOME}/.zsh_antidote
fi
# zsh-vi-mode configuration
function zvm_config() {
ZVM_INIT_MODE=sourcing
ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
ZVM_VI_INSERT_ESCAPE_BINDKEY=jk
}
# source antidote and load plugins
source ${ZDOTDIR:-$HOME}/.zsh_antidote/antidote.zsh
antidote load ${ZDOTDIR:-$HOME}/.zsh_plugins.txt
bindkey '^L' autosuggest-accept
zstyle ':fzf-tab:*' fzf-bindings 'ctrl-l:accept'
zstyle ':fzf-tab:complete:*:*' fzf-preview $FILE_VIEWER '${(Q)realpath}'
autoload -U promptinit && promptinit
prompt powerlevel10k
#-------------------------------------------------------------------------
zle_highlight+=(paste:none)
alias h="history"
setopt IGNORE_EOF
HISTFILE="${HISTFILE:-${ZDOTDIR:-$HOME}/.zsh_history}"
HISTSIZE=50000
SAVEHIST=$HISTSIZE
setopt BANG_HIST # treat the '!' character specially during expansion
setopt EXTENDED_HISTORY # write the history file in the ':start:elapsed;command' format
setopt SHARE_HISTORY # share history between all sessions
setopt INC_APPEND_HISTORY # write history immeditely, not when the shell exits
setopt APPEND_HISTORY # share history between all sessions (after exit)
setopt HIST_EXPIRE_DUPS_FIRST # expire a duplicate event first when trimming history
setopt HIST_IGNORE_DUPS # do not record an event that was just recorded again
setopt HIST_IGNORE_ALL_DUPS # delete an old recorded event if a new event is a duplicate
setopt HIST_FIND_NO_DUPS # do not display a previously found event
setopt HIST_IGNORE_SPACE # do not record an event starting with a space
setopt HIST_SAVE_NO_DUPS # do not write a duplicate event to the history file
setopt HIST_VERIFY # do not execute immediately upon history expansion
setopt HIST_BEEP # beep when accessing non-existent history
unset zle_bracketed_paste
# _set_window_title() {
# print -Pn "\033]0;👻 %20<…<%~%<<\007"
# }
# autoload -Uz add-zsh-hook
# add-zsh-hook precmd _set_window_title
# _set_window_title
alias rm="/bin/rm -i"
alias mv="/bin/mv -i"
alias cp="/bin/cp -i"
alias rmrf="/bin/rm -rf"
if (( $+commands[eza] )); then
alias ls="eza --icons -F always"
alias ll="eza --icons -l -F always"
alias la="eza --icons -a -F always"
alias lal="eza --icons -la -F always"
alias lst="eza --icons -F always -s modified -r"
alias llt="eza --icons -l -F always -s modified -r"
alias lat="eza --icons -a -F always -s modified -r"
alias lalt="eza --icons -la -F always -s modified -r"
elif (( $+commands[lsd] )); then
alias ls="lsd -F"
alias ll="lsd -lF"
alias la="lsd -aF"
alias lal="lsd -laF"
alias lst="lsd -Ft"
alias llt="lsd -lFt"
alias lat="lsd -aFt"
alias lalt="lsd -laFt"
else
alias ls="lsd -F"
alias ll="lsd -lF"
alias la="lsd -aF"
alias lal="lsd -laF"
alias lst="lsd -Ft"
alias llt="lsd -lFt"
alias lat="lsd -aFt"
alias lalt="lsd -laFt"
fi
export PAGER=$FILE_VIEWER
export BAT_PAGER="less -rFX"
if (( $+commands[bat] )); then
export MANPAGER="bat -l man --color=always --style=plain"
elif (( $+commands[batcat] )); then
export MANPAGER="batcat -l man --color=always --style=plain"
else
export MANPAGER="less -s"
fi
alias cat=$PAGER
alias more=$PAGER
alias less=$PAGER
if (( $+commands[qlmanage] )); then
alias ql="qlmanage -p"
fi
if (( $+commands[nvim] )); then
if (( $+commands[proxychains4] )); then
#alias vi="NODE_TLS_REJECT_UNAUTHORIZED=0 proxychains4 nvim"
alias vi="proxychains4 nvim"
else
alias vi="nvim"
fi
fi
# if exists, override to a nightly neovim build
if [[ -d $HOME/nvim/bin ]]; then
if (( $+commands[proxychains4] )); then
alias vi="proxychains4 $HOME/nvim/bin/nvim"
else
alias vi="$HOME/nvim/bin/nvim"
fi
fi
if (( $+commands[dust] )); then
alias du="dust"
fi
if (( $+commands[duf] )); then
alias df="duf"
fi
if (( $+commands[prettyping] )); then
alias ping="prettyping --nolegend"
fi
if [[ -x $HOME/zig/zig ]]; then
alias zig="$HOME/zig/zig"
fi
if [[ -d $HOME/.opencode/bin ]]; then
export PATH="$HOME/.opencode/bin:$PATH"
fi
if (( $+commands[proxychains4] )); then
#alias claude="proxychains4 claude"
alias claude="NODE_TLS_REJECT_UNAUTHORIZED=0 proxychains4 claude"
alias codex="proxychains4 codex"
alias gemini="proxychains4 gemini"
alias opencode="proxychains4 opencode"
alias docling="proxychains4 docling"
fi
alias bitz="$HOME/work/git/bitz/bitz.py"
alias nostalgic="$HOME/work/git/nostalgic/nostalgic"
export PYENV_ROOT="$HOME/.pyenv"
if [[ -d $PYENV_ROOT/bin ]]; then
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - zsh)"
fi
#export FZF_DEFAULT_OPTS="--no-mouse --bind ctrl-p:toggle-preview,pgdn:preview-page-down,pgup:preview-page-up,ctrl-d:page-down,ctrl-u:page-up --color='hl:39,hl+:39:bold'"
eval "$(zoxide init zsh)"
if [[ -d ~/.priv ]]; then
source ~/.priv/zshrc
fi
if [[ $(hostname) = ubuntu13 ||
$(hostname) = ubuntu42 ]]; then
echo "insecure" > $HOME/.curlrc
export HOMEBREW_CURLRC=1
fi
#-------------------------------------------------------------------------
# to customize prompt, run `p10k configure` or edit ~/.p10k.zsh
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh