-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
131 lines (103 loc) · 3.36 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
# zmodload zsh/zprof
skip_global_compinit=1
ZPLUG_HOME=~/.zplug
HISTFILE=~/.zsh_history
HISTSIZE=30000
SAVEHIST=30000
# check if zplug is installed
if [[ ! -d $ZPLUG_HOME ]]; then
git clone /~https://github.com/zplug/zplug $ZPLUG_HOME
source $ZPLUG_HOME/init.zsh && zplug update
fi
source $ZPLUG_HOME/init.zsh
fpath=(~/.local/share/zsh/functions $fpath)
autoload -Uz add-zsh-hook
autoload -Uz compinit
compinit -u
# aliases, exports, and functions
source ~/.dotfiles/.aliases
source ~/.dotfiles/.exports
source ~/.dotfiles/.functions
# options
setopt append_history \
hist_ignore_dups \
hist_ignore_space \
hist_reduce_blanks \
inc_append_history
# apply and customize spaceship theme
zplug "denysdovhan/spaceship-prompt", as:theme
SPACESHIP_CHAR_SUFFIX=" "
SPACESHIP_CHAR_SYMBOL=❯
SPACESHIP_DOCKER_SHOW=false
SPACESHIP_GCLOUD_SHOW=false
SPACESHIP_PROMPT_ADD_NEWLINE=false
# oh-my-zsh plugins
zplug "plugins/battery", from:oh-my-zsh
zplug "plugins/chucknorris", from:oh-my-zsh
zplug "plugins/colored-man-pages", from:oh-my-zsh
zplug "plugins/colorize", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "plugins/dirhistory", from:oh-my-zsh
zplug "plugins/fnm", from:oh-my-zsh
zplug "plugins/fzf", from:oh-my-zsh
zplug "plugins/macos", from:oh-my-zsh
zplug "plugins/rust", from:oh-my-zsh
zplug "plugins/sublime", from:oh-my-zsh
# miscellaneous plugins
zplug "Aloxaf/fzf-tab"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "zsh-users/zsh-history-substring-search", defer:3
# plugin options
export FZF_DEFAULT_OPTS="--border --layout=reverse --no-sort --prompt=\"ಠ_ಠ \""
# ensure packages are installed then load
zplug check || zplug install
zplug load # --verbose
# bind up and down arrow keys
if zplug check "zsh-users/zsh-history-substring-search"; then
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
fi
# bind option + left and option + right
bindkey '^[^[[D' backward-word
bindkey '^[^[[C' forward-word
# bind shift + tab
# /~https://github.com/zsh-users/zsh-autosuggestions#key-bindings
bindkey '^[[Z' autosuggest-execute
# https://cli.github.com
source <(gh completion -s zsh)
# /~https://github.com/Schniz/fnm
eval "$(fnm env)"
# /~https://github.com/helm/helm
source <(helm completion zsh)
# /~https://github.com/istio/istio
source <(istioctl completion zsh)
# /~https://github.com/jenv/jenv
eval "$(jenv init -)"
# /~https://github.com/kubernetes-sigs/kind
source <(kind completion zsh)
# /~https://github.com/kubernetes/kubernetes
source <(kubectl completion zsh)
# /~https://github.com/cantino/mcfly
eval "$(mcfly init zsh)"
# /~https://github.com/pyenv/pyenv
eval "$(pyenv init -)"
# /~https://github.com/pyenv/pyenv-virtualenv
eval "$(pyenv virtualenv-init -)"
# /~https://github.com/rbenv/rbenv
eval "$(rbenv init - zsh)"
# /~https://github.com/ajeetdsouza/zoxide
eval "$(zoxide init zsh)"
# bun completions
[[ -s $HOME/.bun/_bun ]] && source $HOME/.bun/_bun
# google cloud sdk completions
GC_SDK=$HOMEBREW_PREFIX/share/google-cloud-sdk
[[ -s $GC_SDK/completion.zsh.inc ]] && source $GC_SDK/completion.zsh.inc
[[ -s $GC_SDK/path.zsh.inc ]] && source $GC_SDK/path.zsh.inc
if [[ "$(whoami)" == "chris_bradley" ]]; then
# platform-operator completions
[[ -s $HOME/go/bin/platctl ]] && source <($HOME/go/bin/platctl completion zsh)
fi
# profiling with zprof
# zprof