-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
98 lines (69 loc) · 2.7 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
unsetopt BEEP # disable bell
setopt correct
setopt globdots
setopt histignoredups
setopt pushd_to_home
setopt pushd_silent
VI_MODE_SET_CURSOR=false
ZSH_AUTOSUGGEST_USE_ASYNC=true
ZSH_DISABLE_COMPFIX=true # Disable 'zsh compinit insecure directoreis' warning
export PROMPT_EOL_MARK=''
autoload -Uz compinit
compinit
source $HOME/.common.shrc
# 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
export FZF_BASE=$HOME/.vim/plugged/fzf
[ ! -d "${HOME}/.zgenom" ] && git clone --depth 1 https://github.com/jandamm/zgenom.git "${HOME}/.zgenom"
source "${HOME}/.zgenom/zgenom.zsh" > /dev/null
source "${HOME}/.zgenom/zgen.zsh" > /dev/null
zgenom autoupdate --background
# Backup my aliases
local _save_aliases="$(alias -L)"
# if the init script doesn't exist
if ! zgen saved; then
zgen oh-my-zsh
zgen oh-my-zsh plugins/command-not-found
zgen oh-my-zsh plugins/vi-mode
zgen oh-my-zsh plugins/gradle
zgen oh-my-zsh plugins/pip
zgen oh-my-zsh plugins/virtualenvwrapper
zgen oh-my-zsh plugins/asdf
zgen oh-my-zsh plugins/poetry
zgen oh-my-zsh plugins/gnu-utils
zgen load lukechilds/zsh-better-npm-completion
zgen load Aloxaf/fzf-tab
zgen load zsh-users/zsh-syntax-highlighting
zgen load zsh-users/zsh-history-substring-search
zgen load zsh-users/zsh-autosuggestions
zgen load zsh-users/zsh-completions
zgen load RobSis/zsh-completion-generator # compgen <program> to parse, and compinit then to apply
zgen load romkatv/powerlevel10k powerlevel10k
zgen load IngoMeyer441/zsh-easy-motion
# generate the init script from plugins above
zgen save
zgenom compile "$HOME/.zshrc"
fi
bindkey '^ ' autosuggest-accept
bindkey -M vicmd ',,' vi-easy-motion # Bind ,, as a prefix key
bindkey -M vicmd -r ',' # Unbind ','
########################
# My Configuration #
########################
# Restore (override) my aliases
eval "$_save_aliases"
unset _save_aliases
# Disable commit-hash-sort when completing git checkout, diff, and so one.
zstyle ':completion:*:git-*:*' sort false
alias cd='pushd'
alias back='popd'
command -v kubectl &> /dev/null && source <(kubectl completion zsh)
command -v k9s &> /dev/null && source <(k9s completion zsh)
command -v helm &> /dev/null && source <(helm completion zsh)
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh