-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc.tmpl
114 lines (86 loc) · 3.7 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
# ~/.zshrc
# shellcheck shell=bash
# shellcheck source=/dev/null
# shellcheck disable=SC2034
# Enable Powerlevel10k instant prompt.
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
{{ if eq .chezmoi.os "darwin" }}
# Brew Configuration
# ---------------------------------------------------------------------------------
export HOMEBREW_NO_AUTO_UPDATE=1
{{ end }}
# ZSH Configuration
# ---------------------------------------------------------------------------------
export PATH={{ .chezmoi.homeDir }}/bin:$PATH
[ -d /snap/bin ] && export PATH=/snap/bin:$PATH
[ -d {{ .chezmoi.homeDir }}/.cargo/bin ] && export PATH={{ .chezmoi.homeDir }}/.cargo/bin:$PATH
[ -d {{ .chezmoi.homeDir }}/go/bin ] && export PATH={{ .chezmoi.homeDir }}/go/bin:$PATH
[ -d {{ .chezmoi.homeDir }}/.local/bin ] && export PATH={{ .chezmoi.homeDir }}/.local/bin:$PATH
[ -d {{ .chezmoi.homeDir }}/.gittools ] && export PATH={{ .chezmoi.homeDir }}/.gittools:$PATH
[ -d {{ .chezmoi.homeDir }}/.bin ] && export PATH={{ .chezmoi.homeDir }}/.bin:$PATH
export ZSH={{ .chezmoi.homeDir }}/.oh-my-zsh
plugins=(
colored-man-pages
gpg-agent
history
kubectl
terraform
rust
golang
z
zsh-syntax-highlighting
vi-mode
colorize
)
# Oh-My-ZSH Theme (disabled)
# ---------------------------------------------------------------------------------
ZSH_THEME="powerlevel10k/powerlevel10k"
DISABLE_AUTO_UPDATE="true"
ZSH_DISABLE_COMPFIX=true
source $ZSH/oh-my-zsh.sh
# TMUX
# ---------------------------------------------------------------------------------
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
exec tmux
fi
{{- if .kubernetes }}
# Kubernetes Config
# ---------------------------------------------------------------------------------
# Get Kubectl Command Completions
source <(kubectl completion zsh)
[[ -f ~/.kube_aliases ]] && source {{ .chezmoi.homeDir }}/.kube_aliases
{{- if .work }}
if [[ -z $KUBECONFIG ]]; then
export KUBECONFIG={{ .chezmoi.homeDir }}/.kube/config
fi
{{- end }}
{{- end }}
# Includes
# ---------------------------------------------------------------------------------
[ -f {{ .chezmoi.homeDir }}/.git_aliases ] && source {{ .chezmoi.homeDir }}/.git_aliases
[ -f {{ .chezmoi.homeDir }}/.bash_aliases ] && source {{ .chezmoi.homeDir }}/.bash_aliases
[ -f {{ .chezmoi.homeDir }}/.bash_exports ] && source {{ .chezmoi.homeDir }}/.bash_exports
[ -f {{ .chezmoi.homeDir }}/.bash_functions ] && source {{ .chezmoi.homeDir }}/.bash_functions
[ -f {{ .chezmoi.homeDir }}/.glab_exports ] && source {{ .chezmoi.homeDir }}/.glab_exports
[ -f {{ .chezmoi.homeDir }}/.zsh_custom ] && source {{ .chezmoi.homeDir }}/.zsh_custom
# GPG ENVIRONMENT FOR VIM-GNUPG PLUGIN
# ---------------------------------------------------------------------------------
export GPG_TTY=`tty`
# History Configuration
# ---------------------------------------------------------------------------------
export HISTSIZE=99999
export HISTFILESIZE=99999
export LESS='-j5 R'
# Less
# ---------------------------------------------------------------------------------
# Set the default Less options.
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
# Remove -X and -F (exit if the content fits on one screen) to enable it.
export LESS='-F -g -i -M -R -S -w -X -z-4'
# ZSH Completion Handling / Initialization
# ----------------------------------------------------------------------------------
[ -f {{ .chezmoi.homeDir }}/.zsh_completions ] && fpath=({{ .chezmoi.homeDir }}/.zsh_completions $fpath)
autoload -U compinit && compinit
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh