2015-12-17 02:29:57 -08:00
|
|
|
is-callable() { (( $+commands[$1] )) || (( $+functions[$1] )) || (( $+aliases[$1] )); }
|
|
|
|
is-mac() { [[ "$OSTYPE" == "darwin"* ]]; }
|
|
|
|
is-deb() { [[ "$OSTYPE" == "linux-gnu" ]]; }
|
|
|
|
is-cygwin() { [[ "$OSTYPE" == "cygwin"* ]]; }
|
|
|
|
|
2015-11-25 14:28:31 -08:00
|
|
|
# Browser
|
|
|
|
export BROWSER='open'
|
|
|
|
|
|
|
|
## Editors
|
|
|
|
export EDITOR='vim'
|
|
|
|
export VISUAL='vim'
|
|
|
|
export PAGER='less'
|
|
|
|
export RUBYOPT=rubygems
|
|
|
|
# export CC=/usr/bin/clang
|
|
|
|
# export CXX=/usr/bin/clang++
|
|
|
|
# export CXXFLAGS="-I/usr/local/include"
|
|
|
|
export C_INCLUDE_PATH="/usr/local/include"
|
|
|
|
export CPLUS_INCLUDE_PATH="/usr/local/include"
|
|
|
|
export LIBRARY_PATH="/usr/local/lib"
|
|
|
|
# export LDFLAGS="-L/usr/local/lib"
|
|
|
|
|
|
|
|
# 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='-X -F -g -i -M -R -S -w -z-4'
|
|
|
|
|
|
|
|
# Set the Less input preprocessor.
|
|
|
|
if (( $+commands[lesspipe] )); then
|
|
|
|
export LESSOPEN='| /usr/bin/env lesspipe %s 2>&-'
|
2014-03-29 14:56:33 -07:00
|
|
|
fi
|
2014-09-20 13:38:40 -07:00
|
|
|
|
2015-11-25 14:28:31 -08:00
|
|
|
# Temporary Files
|
|
|
|
if [[ ! -d "$TMPDIR" ]]; then
|
|
|
|
export TMPDIR="/tmp/$USER"
|
|
|
|
mkdir -p -m 700 "$TMPDIR"
|
|
|
|
fi
|
|
|
|
|
|
|
|
TMPPREFIX="${TMPDIR%/}/zsh"
|
|
|
|
[[ ! -d "$TMPPREFIX" ]] && mkdir -p "$TMPPREFIX"
|
|
|
|
|
|
|
|
## Language
|
|
|
|
[[ -z "$LANG" ]] && export LANG='en_US.UTF-8'
|
|
|
|
|
|
|
|
## Paths
|
|
|
|
# Ensure path arrays do not contain duplicates.
|
|
|
|
typeset -gU cdpath fpath mailpath path
|
|
|
|
|
|
|
|
##
|
|
|
|
export DOCKER_HOST=tcp://server:4243
|
|
|
|
|
|
|
|
export RUST_SRC_PATH=$HOME/Dropbox/lib/rust/src
|
|
|
|
export GOPATH=$HOME/Dropbox/work/go
|
|
|
|
export ANDROID_HOME=/usr/local/opt/android-sdk
|
|
|
|
export ANDROID_SDK=/usr/local/Cellar/android-sdk/24.2
|
|
|
|
|
|
|
|
# basictex
|
|
|
|
# export PATH=/usr/local/texlive/2015basic/bin/x86_64-darwin:$PATH
|
|
|
|
|
|
|
|
# Set the list of directories that Zsh searches for programs.
|
|
|
|
path=(
|
2015-12-08 22:42:27 -08:00
|
|
|
$HOME/.dotfiles/{bin,scripts}
|
2015-11-25 14:28:31 -08:00
|
|
|
/usr/local/{bin,sbin}
|
|
|
|
/usr/{bin,sbin}
|
|
|
|
/{bin,sbin}
|
|
|
|
$HOME/.{rb,py}env/bin
|
|
|
|
$GOPATH/bin
|
|
|
|
$ANDROID_HOME/platform-tools
|
|
|
|
$ANDROID_HOME/tools
|
2015-12-08 22:12:58 -08:00
|
|
|
/Library/TeX/texbin
|
2015-11-25 14:28:31 -08:00
|
|
|
$path
|
|
|
|
)
|
|
|
|
|
2015-12-17 02:29:57 -08:00
|
|
|
local FUNC_DIR="$HOME/.dotfiles/zsh/functions"
|
2015-11-25 14:28:31 -08:00
|
|
|
fpath=(
|
|
|
|
~/.zsh/completion
|
2015-12-17 02:29:57 -08:00
|
|
|
"$FUNC_DIR"
|
2015-11-25 14:28:31 -08:00
|
|
|
$fpath
|
|
|
|
)
|
2015-12-17 02:29:57 -08:00
|
|
|
|
|
|
|
# Load all scripts from ./zsh/functions/*
|
|
|
|
for func in "$FUNC_DIR"/*(N-.x:t); do
|
|
|
|
autoload -Uz $func
|
|
|
|
done
|