-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc.tmpl
104 lines (84 loc) · 2.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
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
export CONFIGS=$HOME/.zsh.d
# 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)
#
{{ if eq .chezmoi.os "darwin" -}}
ZSH_THEME="robbyrussell"
plugins=(git ruby brew macos tmux screen aws docker httpie safe-paste iterm2)
{{ else }}
ZSH_THEME="gentoo"
plugins=(git ruby tmux screen aws docker httpie safe-paste)
{{ end }}
# If we've got brew installed, get the brew completion scripts loaded before
# oh-my-zsh. https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
fi
source $ZSH/oh-my-zsh.sh
# ssh
zstyle :omz:plugins:ssh-agent identities id_rsa id_rsa2 id_github
# your project folder that we can `c [tab]` to
export PROJECTS=~/projects
# Stash your environment variables in ~/.localrc. This means they'll stay out
# of your main dotfiles repository (which may be public, like this one), but
# you'll have access to them in your scripts.
if [[ -a ~/.localrc ]]
then
source ~/.localrc
fi
##############################
## Dotfiles project loading
##############################
# all of our zsh files
typeset -U config_files
config_files=($CONFIGS/**/*.zsh)
# load the path files
for file in ${(M)config_files:#*/path.zsh}
do
source $file
done
# load everything but the path and completion files
for file in ${${config_files:#*/path.zsh}:#*/completion.zsh}
do
source $file
done
# initialize autocomplete here, otherwise functions won't be loaded
autoload -U compinit
compinit -D
# load every completion after autocomplete loads
for file in ${(M)config_files:#*/completion.zsh}
do
source $file
done
unset config_files
##################
# Load misc tools
##################
export PATH=${HOME}/bin:${PATH}
{{ if eq .chezmoi.os "darwin" -}}
if [ -e {{ output "brew" "--prefix" | trim }}/share/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh ]
then
source {{ output "brew" "--prefix" | trim }}/share/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh
fi
if [ -e "${HOME}/.iterm2_shell_integration.zsh" ]
then
source "${HOME}/.iterm2_shell_integration.zsh"
fi
{{ end }}
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
if type pyenv > /dev/null
then
eval "$(pyenv init -)"
fi
{{ if eq .chezmoi.os "darwin" -}}
if [[ -S ~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh ]]; then
export SSH_AUTH_SOCK=~/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh
fi
{{ end }}
# Enable extended glob to allow ^ negation in shell globs
setopt extendedglob
# vim:ft=zsh