summary refs log tree commit diff stats
path: root/tag-zsh/config/zsh/zshenv
blob: 8e1fd025e1357c2a5893003961f5097feedfdac5 (plain)
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
# -*- mode: sh; -*-
export GOPATH="$HOME/projects/go"

if [[ $defpath == "" ]]
then
	defpath=($path)
	path=(
		$defpath
		~/bin
		$GOPATH/bin
		~/.cabal/bin
		~/.composer/vendor/bin
	)
fi

export PATH

myfuncs=( $ZDOTDIR/functions/*(/) )
fpath=(
	$myfuncs
	$ZDOTDIR/completion/
	$fpath
)
if [[ -d /usr/local/share/zsh-completions ]]
then
	fpath=(/usr/local/share/zsh-completions $fpath)
fi

if [[ -d /usr/local/share/zsh/site-functions ]]
then
	fpath=(/usr/local/share/zsh/site-functions $fpath)
fi

if [[ -d /usr/local/opt/pass/share/zsh/site-functions ]]
then
	fpath=($fpath /usr/local/opt/pass/share/zsh/site-functions)
fi

export FPATH

case $OSTYPE in
	*gnu*)
		os=gnu
		;;
	freebsd*)
		os=freebsd
		;;
	darwin*)
		os=osx
esac

export os

if [[ -s $commands[direnv] ]]
then
	eval "$(direnv hook zsh)"
fi

if [[ $os == gnu && ! -S $SSH_AUTH_SOCK && -s $commands[envoy] ]]
then
	envoy -t gpg-agent
	eval $(envoy -p)
fi

if [[ -f $ZDOTDIR/zshenv.local ]]
then
	. $ZDOTDIR/zshenv.local
fi

if [[ -f $ZDOTDIR/zshenv.private ]]
then
	. $ZDOTDIR/zshenv.private
fi