-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
executable file
·156 lines (119 loc) · 4.48 KB
/
dot_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
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/.local/bin:$HOME/bin:/usr/local/bin:$PATH
export MANPATH=$HOME/.local/man:$MANPATH
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
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
# Zinit Home
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
source "${ZINIT_HOME}/zinit.zsh"
# Create cache and completions dir and add to $fpath (for OMZ Plugins)
mkdir -p "$ZSH_CACHE_DIR/completions"
(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)
# Zinit Module
# module_path+=( "$ZINIT_HOME/bin/zmodules/Src" )
# zmodload zdharma-continuum/zplugin
# Skips the global compinit
skip_global_compinit=1
# Uncomment to check loading times
# zpmod source-study
# Functions to make zinit configuration less verbose
zpt() { zinit ice wait"${1}" lucid "${@:2}"; } # Turbo
zpi() { zinit ice lucid "${@}"; } # Regular Ice
zp() { [ -z $2 ] && zinit light "${@}" || zinit "${@}"; } # zinit
# ************
# * Binaries *
# ************
# enhancd
zpt 0 atclone"source ./init.sh"; zp babarot/enhancd
# eza
zpt 0 from"gh-r" as"command"; zp eza-community/eza
# fzf
zpt 0 from"gh-r" as"command"; zp junegunn/fzf-bin
zp Aloxaf/fzf-tab
# fzy
# zplug "jhawthorn/fzy", as:command, rename-to:fzy, hook-build:"make && PREFIX=$HOME/.local make install"
# jq
zpt 0 from"gh-r" as"command" mv"jq-* -> jq"; zp jqlang/jq
# kubebox
zpt 0 from"gh-r" as"command" mv"kubebox-* -> kubebox"; zp astefanutti/kubebox
# ripgrep
# zplug "BurntSushi/ripgrep", from:gh-r, as:command, rename-to:rg
# zplug "plugins/ripgrrep", from:oh-my-zsh
# task
zpt 0 from"gh-r" as"command"; zp go-task/task
# ************
# * Funtions *
# ************
# Oh My Zsh - /lib/
zpt 0a; zp snippet OMZL::clipboard.zsh
zpt 0a; zp snippet OMZL::completion.zsh
zpt 0a; zp snippet OMZL::correction.zsh
zpt 0a; zp snippet OMZL::functions.zsh
zpt 0a; zp snippet OMZL::git.zsh
zpt 0a; zp snippet OMZL::history.zsh
zpt 0a; zp snippet OMZL::key-bindings.zsh
zpt 0a; zp snippet OMZL::termsupport.zsh
# ***********
# * Plugins *
# ***********
# Oh My Zsh - /plugins/
zpt 0a; zp snippet OMZP::brew/brew.plugin.zsh
zpt 0a; zp snippet OMZP::command-not-found/command-not-found.plugin.zsh
zpt 0a; zp snippet OMZP::docker/docker.plugin.zsh
zpt 0a; zp snippet OMZP::docker-compose/docker-compose.plugin.zsh
zpt 0a; zp snippet OMZP::eza/eza.plugin.zsh
zpt 0a; zp snippet OMZP::git/git.plugin.zsh
zpt 0a; zp snippet OMZP::kubectl/kubectl.plugin.zsh
zpt 0a; zp snippet OMZP::sudo/sudo.plugin.zsh
# Zsh Users
zpt 0b '{src/*.zsh,src/strategies/*}' atload'_zsh_autosuggest_start'; zp zsh-users/zsh-autosuggestions
# zp zsh-users/zsh-syntax-highlighting
zp zsh-users/zsh-history-substring-search
# zdharma-continuum
zpt 0b; zp zdharma-continuum/fast-syntax-highlighting
# Yarn Auto Completions
zpt 0 atclone"./zplug.zsh"; zp g-plane/zsh-yarn-autocompletions
# Powerlevel10k
zpi depth"1"; zp romkatv/powerlevel10k
# kubectx / kubens
zpi depth"1"; zp unixorn/kubectx-zshplugin
# n
zpi depth"1"; zp gretzky/n.zsh
# *********************
# * Setup Completions *
# *********************
zpt 0a atload"zicompinit; zicdreplay" blockf atpull'zinit creinstall -q .'; zp zsh-users/zsh-completions
autoload -Uz compinit && compinit
autoload -U +X bashcompinit && bashcompinit
# ******************
# * Plugin Configs *
# ******************
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# ******************
# * Custom Configs *
# ******************
for file in ~/.zsh_configs/*.zsh(.N); do
source "$file"
done
# ***************
# * User Config *
# ***************
# Load local config, if present
[ -f ~/.zshrc.local ] && source ~/.zshrc.local
# Overrides
unsetopt share_history
# Exports
export GPG_TTY=$(tty)
# *********************
# * Setup Other Tools *
# *********************
# Setup `n` if installed via `n-install`
export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"