zsh/zshenv
Kenneth Benzie (Benie) 0ab04406ec Fix macOS PATH being rewritten in /etc/zprofile
macOS is obnoxious and overwrites the PATH from a users ~/.zshenv, which is
sourced first, in /etc/zprofile by calling `/usr/libexec/path_helper -s` so
this is required so that PATH is once again set to the desired value.
2018-08-26 20:19:12 +01:00

57 lines
1.7 KiB
Bash

# .zshenv [0] Used for setting user's environment variables; it should not
# contain commands that produce output or assume the shell is attached to a
# tty. This file will always be sourced.
# Enable saving command history to file
[ ! -d $HOME/.cache/zsh ] && mkdir -p $HOME/.cache/zsh
HISTFILE=$HOME/.cache/zsh/histfile
HISTSIZE=5000
SAVEHIST=5000
# Enable time stats for long lasting commands
REPORTTIME=5
# Add Homebrew python to PATH on macOS if present
[ -d /usr/local/opt/python/libexec/bin ] && \
PATH=/usr/local/opt/python/libexec/bin:$PATH
# Add ~/.local to the environment
fpath+=$HOME/.local/share/zsh/site-functions
PATH=$HOME/.local/bin:$PATH
MANPATH=$HOME/.local/share/man:$MANPATH
INFOPATH=$HOME/.local/share/info:$INFOPATH
if [ `uname` = Darwin ]; then
[ -f /usr/local/bin/ccache ] && \
PATH=/usr/local/opt/ccache/libexec:$PATH
else
[ -f /usr/bin/ccache ] && \
PATH=/usr/lib/ccache:$PATH
fi
# Remove duplicates from environment variables
typeset -U fpath
typeset -U PATH; export PATH
typeset -U MANPATH; export MANPATH
typeset -U INFOPATH; export INFOPATH
# Use ~/.local for pip installs on macOS
[ "`uname`" = "Darwin" ] && export PYTHONUSERBASE=$HOME/.local
# Change colors used by less and man
export LESS_TERMCAP_mb=`printf "\e[0;31m"`
export LESS_TERMCAP_md=`printf "\e[0;36m"`
export LESS_TERMCAP_me=`printf "\e[0m"`
export LESS_TERMCAP_so=`printf "\e[1;40;32m"`
export LESS_TERMCAP_se=`printf "\e[0m"`
export LESS_TERMCAP_us=`printf "\e[0;34m"`
export LESS_TERMCAP_ue=`printf "\e[0m"`
# Force GoogleTest to output colors
export GTEST_COLOR=yes
# Allow completions for GoogleTest break on failure
export GTEST_BREAK_ON_FAILURE=0
# Disable virtualenv prompt
VIRTUAL_ENV_DISABLE_PROMPT=1