-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.zshrc
207 lines (153 loc) · 5.46 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
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Skip ubuntu global compinit
skip_global_compinit=1
autoload -Uz compinit
compinit
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
export PATH="/home/rw21/Code/zsh-scripts:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="/home/rw21/.yarn/bin:$PATH"
export PATH="$PATH:$(go env GOPATH)/bin"
export PATH="/usr/local/opt/libpq/bin:$PATH"
zinit wait lucid for \
OMZL::git.zsh \
atload"unalias grv" \
OMZP::git
# Theme
PS1="READY >"
zinit wait'!' lucid for \
OMZL::prompt_info_functions.zsh \
OMZT::gnzh
if [[ "$(uname)" == "Darwin" ]]; then
alias love="/Applications/love.app/Contents/MacOS/love"
fi
if [[ "$(uname)" == "Darwin" ]]; then
export FZF_BASE="$HOME/.local/share/zinit/plugins/junegunn---fzf/fzf"
fi
# FZF
zinit ice from"gh-r" as"program"
zinit light junegunn/fzf
zinit snippet https://github.com/junegunn/fzf/blob/master/shell/key-bindings.zsh
# Update function from key-bindings.zsh
fzf-history-widget-updated() {
fc -RI
eval "fzf-history-widget"
}
zle -N fzf-history-widget-updated
bindkey -M emacs '^R' fzf-history-widget-updated
bindkey -M vicmd '^R' fzf-history-widget-updated
bindkey -M viins '^R' fzf-history-widget-updated
zinit snippet https://github.com/junegunn/fzf/blob/master/shell/completion.zsh
#zinit ice lucid wait'0'
#zinit light joshskidmore/zsh-fzf-history-search
zinit ice wait lucid
zinit light Aloxaf/fzf-tab
export FZF_DEFAULT_COMMAND="rg --files --hidden --follow --glob '!.git'"
export FZF_DEFAULT_OPTS="--ansi --height 60%"
export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'"
export FZF_COMPLETION_TRIGGER=','
zinit snippet OMZ::plugins/git/git.plugin.zsh
zinit snippet OMZ::plugins/common-aliases/common-aliases.plugin.zsh
zinit snippet OMZ::plugins/docker-compose/docker-compose.plugin.zsh
# zinit snippet OMZ::plugins/fzf/fzf.plugin.zsh
zinit snippet OMZ::plugins/kubectl/kubectl.plugin.zsh
zinit snippet OMZ::plugins/gcloud/gcloud.plugin.zsh
zinit ice wait lucid
zinit light zsh-users/zsh-completions
zinit ice wait lucid
zinit light zsh-users/zsh-autosuggestions
zinit ice wait lucid
zinit load agkozak/zsh-z
alias oex="nautilus --browser"
alias bat="batcat"
# alias vim="nvim"
alias settings="env XDG_CURRENT_DESKTOP=GNOME gnome-control-center"
alias clipboard="pbcopy"
alias globalip="dig +short myip.opendns.com @resolver1.opendns.com"
cheat() {
curl cht.sh/"$@"
}
# gcloud
alias gcloud-current-project="gcloud config get-value core/project"
alias gcloud-token="gcloud auth print-identity-token"
export CLOUDSDK_PYTHON=/usr/bin/python3
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
# Dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
ZSH_TMUX_AUTOSTART=true
export TERM=xterm-256color
# export EDITOR=nvim
export GIT_EDITOR=vim
export ANSIBLE_COW_SELECTION=random
setopt EXTENDED_HISTORY
export HISTFILE=~/.zsh_history
export HISTSIZE=1000000000
export SAVEHIST=$HISTSIZE
# setopt INC_APPEND_HISTORY
#unsetopt INC_APPEND_HISTORY
#unsetopt no_share_history
setopt share_history
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_FIND_NO_DUPS
setopt HIST_SAVE_NO_DUPS
export HISTTIMEFORMAT="[%F %T] "
#zshaddhistory() {
# setopt LOCAL_OPTIONS
# setopt EXTENDED_GLOB
# print -sr -- "${1%%$'\n'##}"
# fc -p "$HISTFILE"
# return 1
#}
bracketed-paste() {
zle .$WIDGET && LBUFFER=${LBUFFER%$'\n'}
}
zle -N bracketed-paste
export NVM_COMPLETION=true
export NVM_SYMLINK_CURRENT="true"
# zinit wait lucid for lukechilds/zsh-nvm
zinit ice wait"1" lucid
zinit load lukechilds/zsh-nvm
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey '^H' backward-kill-word
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias ~="cd ~"
zinit ice id-as="kubectl" as"command" # atload"kubectl completion zsh > _kubectl"
zinit snippet "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl"
# zinit light-mode lucid wait has"kubectl" for \
# id-as"kubectl-completion" \
# as"completion" \
# atclone"kubectl completion zsh > _kubectl" \
# atpull"%atclone" \
# zdharma/null
source <(kubectl completion zsh)
alias k="kubectl"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/homebrew/Caskroom/miniconda/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then
. "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh"
else
export PATH="/opt/homebrew/Caskroom/miniconda/base/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<