-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc.tmpl
155 lines (121 loc) · 3.9 KB
/
dot_zshrc.tmpl
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
# Use VIM as default editor
export VISUAL=vim
export EDITOR="$VISUAL"
# Path to your oh-my-zsh installation.
export ZSH="/home/{{- .system.user -}}/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="af-magic"
# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="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"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Load ohmyzsh
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Load antigen
source ~/antigen.zsh
# Load oh-my-zsh's library
antigen use oh-my-zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh)
antigen bundle git
antigen bundle docker
antigen bundle sudo
antigen bundle screen
antigen bundle dotenv
# Syntax highlighting bundle.
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-completions
# Load the theme
antigen theme af-magic
# Tell Antigen that you're done
antigen apply
# Enable homebrew completions
if command -v brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
fi
# Custom git aliases
alias gmv="git mv"
if hash nvim &>/dev/null; then
alias vi="nvim"
alias vim="nvim"
fi
if command -v fzf &>/dev/null; then
if [[ ! -f ~/.fzf.zsh ]]; then
# fzf completions are missing, generate them
if which fzf | grep -q "brew"; then
# fzf is installed with brew
"$(brew --prefix fzf)/install"
fi
fi
if command -v fd &>/dev/null; then
export FZF_DEFAULT_COMMAND="fd --type f --color=never"
fi
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
source <(fzf --zsh)
fi
zstyle ':completion:*' menu select
mkdir -p ~/.zfunc &>/dev/null
fpath+=~/.zfunc
{{ if .system.multi_user_system -}}
autoload -U +X compinit && compinit -u
{{- else -}}
autoload -U +X compinit && compinit
{{- end }}
autoload -U +X bashcompinit && bashcompinit
if hash pipx &>/dev/null; then
# Register pipx completions
eval "$(register-python-argcomplete pipx)"
fi
if hash poetry &>/dev/null; then
# Register poetry completions
poetry completions zsh > ~/.zfunc/_poetry
fi
if hash chezmoi &>/dev/null; then
# Register chezmoi completions
chezmoi completion zsh --output ~/.zfunc/_chezmoi
fi
if hash npm &>/dev/null; then
# Register npm completions
npm completion > ~/.zfunc/_npm
fi
if hash jfrog &>/dev/null; then
# Register jfrog-cli completions
local jfrog_completions="~/.jfrog/jfrog_zsh_completions"
if [[ ! -f "${jfrog_completions}" ]]; then
jfrog completion zsh --install >/dev/null
fi
source ~/.jfrog/jfrog_zsh_completion
fi
if command -v az &>/dev/null; then
# Register Azure-DevOps completions
source $(brew --prefix)/etc/bash_completion.d/az
fi
{{ if .personal.work_env -}}
source "$WORK_ZSH_RC_EXTENSION"
{{- end }}