-
Notifications
You must be signed in to change notification settings - Fork 7
/
dot_zshrc
117 lines (96 loc) · 4.17 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
#
# reminder: to update antigen: run `antigen selfupdate` and commit any changes
# to update plugins run `antigen update`
#
zmodload zsh/zprof
export PATH=$PATH:/usr/local/sbin
if [[ "$OSTYPE" =~ darwin ]] && [[ "$(uname -p)" == "arm" ]]; then
export PATH=/opt/homebrew/bin:$PATH
fi
export "PATH=$HOME/.bin:$PATH"
[[ -d "$HOME/.local/bin" ]] && export "PATH=$PATH:$HOME/.local/bin"
# path to completions
fpath=(/usr/local/share/zsh/site-functions $fpath)
skip_global_compinit=1
autoload -Uz compinit && compinit
autoload -Uz bashcompinit
bashcompinit -i
autoload -U +X bashcompinit && bashcompinit
# configure zsh-autosuggestions
export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=80
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE=fg=242
# allow ctrl + [space] to accept autosuggestions in addition to the default right-arrow-key
bindkey '^ ' autosuggest-accept
###
### begin antigen. KEEP ANTIGEN STUFF AT THE BOTTOM ELSE YOU WILL HAVE A BAD TIME (MOSTLY WITH COMPLETIONS NOT WORKING)
###
source ~/.antigen.zsh
# load modules supplied by oh-my-zsh project
antigen use oh-my-zsh
if [[ "$OSTYPE" =~ darwin ]]; then
antigen bundle macos
fi
antigen bundle git
# antigen bundle chruby # DISABLED: slows startup down. disabled. https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins#chruby
#antigen bundle web-search # adds commands google|bing|ddg https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins#web-search
# antigen bundle vagrant # DISABLED: slows startup down.
#antigen bundle systemd # https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins#systemd
# antigen bundle bundler # https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins#bundler
# antigen bundle composer # https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins#composer
antigen bundle docker # https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins#docker
#antigen bundle fabric # https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins#fabric
# antigen bundle encode64 # adds commands encode64|decode64 (https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins#encode64)
# antigen bundle per-directory-history # ctrl-G to toggle global | per-dir history
#antigen bundle sudo # ESC twice: Puts sudo in front of the current command, or the last one if the command line is empty.
#antigen bundle urltools # adds commands urlencode | urldecode
#antigen bundle safe-paste # bracketed-paste support (http://cirw.in/blog/bracketed-paste)
antigen bundle terraform
antigen bundle fzf
antigen bundle zsh-users/zsh-completions src
antigen bundle marlonrichert/zsh-hist
antigen bundle mroth/evalcache
# load non-omz modules
if [[ "$(uname)" != "OpenBSD" ]]; then
# don't load this on openbsd. it slows down prompt re-draw significantly
export ZSH_AUTOSUGGEST_USE_ASYNC=1
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-syntax-highlighting
#antigen bundle djui/alias-tips
fi
antigen apply
# load common bash/zsh compatible shell configs
for rc in "$HOME/.common.sh.d"/*; do
source "$rc"
done
# load zsh configs
for rc in "$HOME/.zsh.d"/*; do
source "$rc"
done
# vi mode settings (for some reason these have to be _after_ antigen)
bindkey -v
bindkey '^r' history-incremental-search-backward
bindkey '^?' backward-delete-char
bindkey '^h' backward-delete-char
bindkey '^w' backward-kill-word
export KEYTIMEOUT=1
source ~/.common.sh.d/tools.sh
# history settings
unsetopt share_history
export HISTFILESIZE=1000000 # override oh-my-zsh's default of 50k
export HISTSIZE=$HISTFILESIZE # override oh-my-zsh's default of 10k
export SAVEHIST=$HISTFILESIZE
export HISTTIMEFORMAT="[%F %T] " # history -E
setopt EXTENDED_HISTORY
# atuin (zsh history tool)
if command -v atuin >/dev/null 2>&1; then
# bind ctrl-r to the atuin modal but not the up-arrow key:
ATUIN_NOBIND=1 # atuin <0.13
source <(atuin init zsh --disable-up-arrow)
bindkey '^r' _atuin_search_widget
fi
# mostly for macos where the default seems to be 256. Need this often for terragrunt run-all
ulimit -n 100000
# set default `time` output format:
# https://zsh.sourceforge.io/Doc/Release/Parameters.html#index-TIMEFMT
TIMEFMT='%U user / %S system / %P cpu %*E total / %K amem / %M maxmem'
complete -o nospace -C /usr/local/bin/vault vault