-
Notifications
You must be signed in to change notification settings - Fork 3
/
zshrc
157 lines (122 loc) · 3.29 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
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.zsh/oh-my-zsh
export ZSH_CUSTOM=$HOME/.zsh/custom
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="bullet-train"
zstyle ':omz:alpha:lib:git' async-prompt no
# Bullettrain config
BULLETTRAIN_CONTEXT_FG="white"
BULLETTRAIN_NVM_FG="black"
BULLETTRAIN_KCTX_KCONFIG=$HOME/.kube/config
BULLETTRAIN_KCTX_BG=blue
BULLETTRAIN_KCTX_FG=white
BULLETTRAIN_PROMPT_ADD_NEWLINE=false
BULLETTRAIN_DIR_EXTENDED=0
BULLETTRAIN_PROMPT_ORDER=(
status
context
dir
virtualenv
nvm
aws
go
custom
kctx
git
hg
cmd_exec_time
)
export SHOW_AWS_PROMPT=false
# 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 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"
# Which plugins would you like to load? (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.
plugins=(
docker
tmux
terraform
aws
vi-mode
history-substring-search
gpg-agent
httpie
bat
asdf
gcloud
exa
fasd
kubectl
zsh-completions
)
ZSH_TMUX_AUTOSTART=${ZSH_TMUX_AUTOSTART:=true}
ZSH_TMUX_AUTOCONECT=false
case $(uname -s) in
*Darwin*)
source $HOME/.zsh/zsh-os-conf/osx-pre-omz.zsh
;;
*Linux*)
source $HOME/.zsh/zsh-os-conf/linux-pre-omz.zsh
;;
esac
PREFILES=($HOME/.zsh/zsh-os-conf/local-pre/*.zsh(N))
for file in $PREFILES; do
source $file
done
source $ZSH/oh-my-zsh.sh
# User configuration
### ENVIRONMENT
EDITOR='vim'
KEYTIMEOUT=1
### ALIASES
alias tmux='tmux -2'
alias loadnvm='[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' # This loads nvm
alias kc='nocorrect kubectl'
### FUNCTIONS
pb () {
curl -F "c=@${1:--}" https://ptpb.pw/
}
TRAPUSR1() {
if [[ -o INTERACTIVE ]]; then
{echo; echo execute a new shell instance } 1>&2
exec "${SHELL}"
fi
}
fpath=(/usr/local/share/zsh-completions $fpath)
zmodload zsh/complist
### KEYBINDINGS
bindkey -M menuselect ' ' accept-and-infer-next-history
bindkey -M menuselect '^?' undo
bindkey "\e\e[D" backward-word # alt + <-
bindkey "\e\e[C" forward-word # alt + ->
### SOURCES
source $HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
. $HOME/.zsh/scripts/exercism_completion.zsh
export NVM_DIR="$HOME/.nvm"
export PATH="$PATH:$HOME/.scripts"
case $(uname -s) in
*Darwin*)
source $HOME/.zsh/zsh-os-conf/osx-post-omz.zsh
;;
*Linux*)
source $HOME/.zsh/zsh-os-conf/linux-post-omz.zsh
;;
esac
POSTFILES=($HOME/.zsh/zsh-os-conf/local-post/*.zsh(N))
for file in $POSTFILES; do
source $file
done
autoload -U compinit && compinit
. /opt/asdf-vm/asdf.sh
fastfetch