-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
143 lines (117 loc) · 3.68 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
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt inc_append_history
setopt share_history
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '$HOME/.zshrc'
# End of lines added by compinstall
### Added by Zinit's installer
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.zinit/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
print -P "%F{160}▓▒░ The clone has failed.%f%b"
fi
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
### End of Zinit's installer chunk
zinit ice pick"async.zsh" src"pure.zsh"
zinit light sindresorhus/pure
zinit ice from"gh-r" as"program"
zinit load junegunn/fzf-bin
zinit load agkozak/zsh-z
zinit wait lucid for \
atinit"zicompinit; zicdreplay" \
OMZP::colored-man-pages
zinit light-mode lucid wait has"kubectl" for \
id-as"kubectl_completion" \
as"completion" \
atclone"kubectl completion zsh > _kubectl" \
atpull"%atclone" \
run-atpull \
zdharma/null
autoload -Uz compinit
compinit
zinit cdreplay -q
zinit cdlist > /dev/null # look at gathered compdefs
autoload -U select-word-style
select-word-style bash
# >>> theme >>>
autoload -U promptinit; promptinit
zstyle :prompt:pure:prompt:success color white
zstyle :prompt:pure:path color green
zstyle :prompt:pure:user color yellow
zstyle :prompt:pure:host color yellow
# <<< theme <<<
# >>> custom >>>
export RUSTUP_UPDATE_ROOT="https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup"
export RUSTUP_DIST_SERVER="https://mirrors.tuna.tsinghua.edu.cn/rustup"
# <<< custom <<<
# >>> alias >>>
case "$OSTYPE" in
darwin*)
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd
alias ls='ls -G'
alias ll='ls -l'
;;
linux*)
alias ls='ls --color'
alias ll='ls -l'
;;
dragonfly*|freebsd*|netbsd*|openbsd*)
# ...
;;
esac
# <<< alias <<<
# >>> gvm >>>
export PATH=/usr/local/go/bin:$PATH
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
go env -w GOPROXY=https://goproxy.io,direct
# <<< gvm <<<
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
fzf-dirs-widget() {
# eval cd $(dirs -v | fzf --height 40% --reverse | cut -b3-)
local dir=$(dirs -v | fzf --height ${FZF_TMUX_HEIGHT:-40%} --reverse | cut -b3-)
if [[ -z "$dir" ]]; then
zle redisplay
return 0
fi
eval cd ${dir}
local ret=$?
unset dir # ensure this doesn't end up appearing in prompt expansion
zle reset-prompt
return $ret
}
zle -N fzf-dirs-widget
# Default ALT-X, For Mac OS: Option-X
if [[ `uname` == "Darwin" ]]; then
bindkey '≈' fzf-dirs-widget
else
bindkey '\ex' fzf-dirs-widget
fi
# >>> final >>>
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
tmux attach -t default || tmux new -s default
fi
export PATH="/opt/tiger/ss_lib/bin:$PATH"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/caowang.5elf/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/caowang.5elf/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/caowang.5elf/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/caowang.5elf/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
export PATH="$HOME/miniconda3/bin:$PATH"
# <<< conda initialize <<<