-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
268 lines (197 loc) · 7.41 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
alias vim=nvim
export EDITOR="vim"
export BROWSER="vivaldi-stable"
export TERM=gnome-256color
export ZSH="$HOME/.oh-my-zsh"
source $ZSH/oh-my-zsh.sh
[[ -e ${ZDOTDIR:-~}/.antidote ]] ||
git clone https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote
# Source antidote.
source ${ZDOTDIR:-~}/.antidote/antidote.zsh
# Initialize antidote's dynamic mode, which changes `antidote bundle`
# from static mode.
source <(antidote init)
#antidote bundle ohmyzsh/ohmyzsh
antidote bundle ohmyzsh/ohmyzsh path:plugins/git
antidote bundle ohmyzsh/ohmyzsh path:plugins/git-auto-fetch
antidote bundle ohmyzsh/ohmyzsh path:plugins/aliases
# antidote bundle themes
antidote bundle ohmyzsh/ohmyzsh path:plugins/dotenv
antidote bundle ohmyzsh/ohmyzsh path:plugins/fzf
antidote bundle ohmyzsh/ohmyzsh path:plugins/command-not-found
# antidote bundle term_tab
antidote bundle ohmyzsh/ohmyzsh path:plugins/kubectl
antidote bundle ohmyzsh/ohmyzsh path:plugins/helm
antidote bundle ohmyzsh/ohmyzsh path:plugins/docker
antidote bundle ohmyzsh/ohmyzsh path:plugins/docker-compose
antidote bundle ohmyzsh/ohmyzsh path:plugins/golang
antidote bundle zsh-users/zsh-completions
antidote bundle zsh-users/zsh-autosuggestions
antidote bundle zsh-users/zsh-syntax-highlighting
antidote bundle spaceship-prompt/spaceship-prompt
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
# antidote theme candy
#antidote bundle atuinsh/atuin path:atuin.plugin.zsh
antidote bundle ohmyzsh/ohmyzsh path:plugins/vscode
antidote bundle ohmyzsh/ohmyzsh path:plugins/thefuck
antidote bundle MichaelAquilina/zsh-you-should-use
# antidote bundle gitlab.com/code-stats/code-stats-zsh
#antigen apply
#
# Install rustup if it isn't installed already
if ! [[ -s "${HOME}/.rustup" ]]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y
fi
VSCODE=codium
alias gcd="git checkout dev"
alias gap="git add -p"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="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=true
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="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"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
export GO111MODULE="on"
export GOBIN=$HOME/go/bin
export PATH=$PATH:$GOBIN
export PATH=$PATH:$HOME/bin:$HOME/go/workspace/bin:/bin:$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/local/snap/bin:/var/lib/snapd/snap/bin:/snap/bin
export PATH=$PATH:$HOME/.composer/vendor/bin
export PATH=$PATH:/sbin:/usr/sbin
export RUSTUP_HOME=$HOME/.rustup
export CARGO_HOME=$HOME/.cargo
export PATH=$CARGO_HOME/bin:$PATH
export PNPM_HOME="$HOME/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"
export ENCORE_INSTALL="$HOME/.encore"
export PATH="$ENCORE_INSTALL/bin:$PATH"
export DOTNET_ROOT=$HOME/.dotnet
export PATH=$DOTNET_ROOT:$PATH
export PATH=$DOTNET_ROOT/tools:$PATH
export JETBRAINS_TOOLBOX="$HOME/.local/share/JetBrains/Toolbox"
export PATH="$JETBRAINS_TOOLBOX/scripts":$PATH
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
#
# The next line updates PATH for the Google Cloud SDK.
if [ -f "$HOME/google-cloud-sdk/path.zsh.inc" ]; then . "$HOME/google-cloud-sdk/path.zsh.inc"; fi
# The next line enables shell command completion for gcloud.
if [ -f "$HOME/google-cloud-sdk/completion.zsh.inc" ]; then . "$HOME/google-cloud-sdk/completion.zsh.inc"; fi
bindkey '^H' backward-kill-word
# Tokei on cd'ing into a repo
LAST_REPO=""
cd() {
builtin cd "$@"
git rev-parse 2>/dev/null
if [ $? -eq 0 ]; then
if [ "$LAST_REPO" != $(basename $(git rev-parse --show-toplevel)) ]; then
tokei
LAST_REPO=$(basename $(git rev-parse --show-toplevel))
fi
fi
}
# requries crates to be installed
alias exa="exa --git --icons --group-directories-first --classify --long --all --header"
tree() {
exa --tree --git-ignore --ignore-glob=".git|node_modules" --level=${1:=3}
}
# aliases
# copy
copy() {
xclip -selection clipboard
}
# find N-largest files
large() {
find . -type f -printf '%s %P\n' | du -bh 2>/dev/null | sort -nr | head -${1:=10}
}
set-wall() {
img=$1
swww img $img
wal -i $img
}
stats() {
url=$(curl -s https://api.atuin.sh/enable -d $(cat ~/.local/share/atuin/session) | tr -d "\"")
wl-copy $url
img=$HOME/Pictures/atuin-stats.png
curl $url -s -output $img
catimg $img
}
# unalias ll
# ll is exa
alias ll="exa"
# grep if needed
# ll() {
# grep=$1
# if [[ -z $grep ]]; then
# exa
# else
# exa | grep -i $grep
# fi
#}
# cats be bats
alias cat="bat"
# Load Angular CLI autocompletion.
# source <(ng completion script)
#source "$HOME/.cargo/env"
eval "$(fnm env --use-on-cd)"
eval "$(starship init zsh)"
source <(atuin init zsh)
#eval "$(atuin init zsh)"
# eval "$(/opt/homebrew/bin/brew shellenv)"
neofetch
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /usr/bin/nomad nomad
#source <(kubectl completion zsh)
eval "$(zoxide init zsh)"
CODESTATS_API_KEY="SFMyNTY.VFc5aWFXeHdZV1JrWlE9PSMjTWpJMU56ST0.BXpgjvJ9pxGoqRu4x9FwPQapj7H7fcaW8mTUrMF-tVk"