-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
122 lines (97 loc) · 3.47 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
# ensure homebrew is setup correctly for linux
test -d $HOME/.linuxbrew && eval $($HOME/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -d /opt/homebrew && eval $(/opt/homebrew/bin/brew shellenv)
command -v brew &> /dev/null && export BREW_PREFIX=$(brew --prefix)
eval $($BREW_PREFIX/bin/brew shellenv)
export DOTFILES=$HOME/dotfiles
export GOPATH=$HOME/go
export PATH="$GOPATH/bin:$HOME/bin:$BREW_PREFIX/bin:$PATH"
export ZPLUG_HOME=$BREW_PREFIX/opt/zplug
source $ZPLUG_HOME/init.zsh
# ensure gpg is working for git
export GPG_TTY=$(tty)
#zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
zplug "bobsoppe/zsh-ssh-agent", use:ssh-agent.zsh, from:github
zplug "plugins/gpg-agent", from:oh-my-zsh
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
# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
# Then, source plugins and add commands to $PATH
zplug load
# END OF ZPLUG STUFF
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=240'
zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}"
# matches case insensitive for lowercase
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# pasting with tabs doesn't perform completion
zstyle ':completion:*' insert-tab pending
# do not autoselect the first completion entry
unsetopt menu_complete
unsetopt flowcontrol
# show completion menu on successive tab press
setopt auto_menu
setopt complete_in_word
setopt always_to_end
setopt complete_aliases
autoload -Uz compinit
compinit
# ============
# key bindings
# ============
bindkey -v
# Let backspace work after switching from insert to normal mode
# See: https://github.com/denysdovhan/spaceship-prompt/issues/91
bindkey "^?" backward-delete-char
bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward
#bindkey "^[[H" beginning-of-line
#bindkey "^[[F" end-of-line
#bindkey "^[[3~" delete-char
#bindkey '^[[1;5C' forward-word
#bindkey '^[[1;5D' backward-word
# =======
# history
# =======
HISTFILE=$HOME/.zsh_history
HISTSIZE=1000000
SAVEHIST=1000000
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
# ignore duplication command history list
setopt hist_ignore_dups
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
# share command history data
setopt share_history
# respect gitignore
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'
# =======
# aliases
# =======
alias reload="source $HOME/.zshrc"
alias aws_whoami="aws sts get-caller-identity"
alias k="kubectl"
alias kctx="kubectx"
alias kns="kubens"
alias vim="nvim"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
test -f $BREW_PREFIX/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc && source "$BREW_PREFIX/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc"
test -f $BREW_PREFIX/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc && source "$BREW_PREFIX/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc"
# ===========================
# local only sensitive things
# ===========================
test -f $HOME/.localrc && source $HOME/.localrc
# finally.. init the prompt
eval "$(starship init zsh)"