-
Notifications
You must be signed in to change notification settings - Fork 33
/
init.zsh
42 lines (37 loc) · 1.08 KB
/
init.zsh
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
#
# dotzsh : https://github.com/dotphiles/dotzsh
#
# Enables local Python package installation.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
# Sebastian Wiesner <lunaryorn@googlemail.com>
# Ben O'Hara <bohara@gmail.com>
#
if (( ! $+commands[python] )); then
return 1
fi
# Prepend PEP 370 per user site packages directory, which defaults to
# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH/MANPATH.
if [[ "$OSTYPE" == darwin* ]]; then
path=($HOME/Library/Python/*/bin(N) $path)
manpath=($HOME/Library/Python/*/{,share/}man(N) $manpath)
else
# This is subject to change.
path=($HOME/.local/bin $path)
manpath=($HOME/.local/{,share/}man(N) $manpath)
fi
# Load virtualenvwrapper into the shell session.
if [[ -n "$WORKON_HOME" ]] && (( $+commands[virtualenvwrapper.sh] )); then
source "$commands[virtualenvwrapper.sh]"
fi
zstyle -a ':dotzsh:module:python' rcfile 'rcfile_argv'
if (( ${#rcfile_argv} > 0 )); then
rcfile=$rcfile_argv
else
rcfile="$HOME/.pythonrc"
fi
# Use pythonrc if it exists
if [[ -e "${rcfile}" ]]; then
export PYTHONSTARTUP="${rcfile}"
fi