2015-03-13 09:08:23 +01:00
|
|
|
HISTFILE=~/.zsh_history
|
2015-03-12 07:33:04 +01:00
|
|
|
HISTSIZE=1000
|
|
|
|
SAVEHIST=1000
|
|
|
|
setopt append_history # append
|
|
|
|
setopt hist_ignore_all_dups # no duplicate
|
|
|
|
unsetopt hist_ignore_space # ignore space prefixed commands
|
|
|
|
setopt hist_reduce_blanks # trim blanks
|
|
|
|
setopt inc_append_history # add commands as they are typed, don't wait until shell exit
|
|
|
|
setopt share_history # share hist between sessions
|
2015-06-01 20:18:19 +02:00
|
|
|
setopt ignoreeof # don't exit the shell on ^D (EOF)
|
2015-03-12 07:33:04 +01:00
|
|
|
|
|
|
|
# emacs bindings
|
|
|
|
bindkey -e
|
|
|
|
# make delete key work
|
|
|
|
bindkey "^[[3~" delete-char
|
|
|
|
bindkey "^[3;5~" delete-char
|
|
|
|
|
|
|
|
# autocomplete
|
|
|
|
autoload -Uz compinit
|
|
|
|
compinit
|
|
|
|
|
|
|
|
# OS-specific things
|
|
|
|
if [[ "$OSTYPE" =~ ^darwin.*$ ]]; then
|
2015-05-05 10:39:45 +02:00
|
|
|
# set pkgsrc paths
|
|
|
|
# see: http://pkgsrc.joyent.com/install-on-osx/
|
2015-07-28 20:13:24 +02:00
|
|
|
PATH=/opt/pkg/sbin:/opt/pkg/bin:$PATH
|
|
|
|
MANPATH=/opt/pkg/man:$MANPATH
|
2015-03-12 07:33:04 +01:00
|
|
|
|
2015-07-30 22:35:19 +02:00
|
|
|
# use pkgsrc's GNU coreutils (prefixed with 'g')
|
|
|
|
# requires at least: coreutils findutils gsed
|
|
|
|
alias du='gdu'
|
|
|
|
alias ls='gls -F --color=auto'
|
|
|
|
alias df='gdf'
|
|
|
|
alias rm='grm'
|
|
|
|
alias cp='gcp'
|
|
|
|
alias mv='gmv'
|
|
|
|
alias mkdir='gmkdir'
|
|
|
|
alias rmdir='grmdir'
|
|
|
|
alias chmod='gchmod'
|
|
|
|
alias chown='gchown'
|
|
|
|
alias ln='gln'
|
|
|
|
alias find='gfind'
|
|
|
|
alias sed='gsed'
|
|
|
|
alias dircolors='gdircolors'
|
2015-08-01 14:35:24 +02:00
|
|
|
alias sort='gsort'
|
2015-08-02 08:38:06 +02:00
|
|
|
# pkgsrc doesn't provide vimdiff wrapper, but it's just `vim -d` anyways
|
|
|
|
alias vimdiff='vim -d'
|
2015-03-12 07:33:04 +01:00
|
|
|
|
2015-06-11 21:56:01 +02:00
|
|
|
# If BasicTeX installation exists, add it to PATH
|
|
|
|
# See: https://tug.org/mactex/morepackages.html
|
2015-07-26 12:23:56 +02:00
|
|
|
[[ -d /usr/local/texlive/2015basic/bin/x86_64-darwin ]] && PATH=$PATH:/usr/local/texlive/2015basic/bin/x86_64-darwin
|
2015-06-11 21:56:01 +02:00
|
|
|
|
2015-05-26 18:26:12 +02:00
|
|
|
elif [[ "$OSTYPE" =~ ^linux.*$ ]]; then
|
2015-05-05 10:39:45 +02:00
|
|
|
# aliases
|
|
|
|
alias ls='ls -F --color=auto'
|
|
|
|
fi
|
2015-03-12 07:33:04 +01:00
|
|
|
|
2015-05-09 17:21:45 +02:00
|
|
|
alias less='less -R' # preserves colors in GNU coreutils' `less`
|
|
|
|
|
2015-05-10 11:32:50 +02:00
|
|
|
# solarized dircolors
|
2015-07-30 22:35:45 +02:00
|
|
|
[[ -r ~/.dircolors.ansi-dark ]] && eval `dircolors ~/.dircolors.ansi-dark`
|
2015-05-10 11:32:50 +02:00
|
|
|
|
2015-03-12 07:33:04 +01:00
|
|
|
# Environment
|
2015-03-13 09:09:01 +01:00
|
|
|
export PS1='[%n@%m: %~]$ '
|
2015-05-05 10:39:45 +02:00
|
|
|
export EDITOR=vim
|
|
|
|
export PAGER=less
|
2015-03-12 07:33:04 +01:00
|
|
|
|
|
|
|
# look for Ansible hosts file in current directory
|
2015-05-09 17:22:32 +02:00
|
|
|
export ANSIBLE_HOSTS=hosts
|
2015-03-12 07:33:04 +01:00
|
|
|
|
2015-05-13 17:47:51 +02:00
|
|
|
# Enable user's "global" npm packages
|
2015-07-26 13:07:40 +02:00
|
|
|
if [[ -d ~/.npm-packages/bin ]]; then
|
2015-05-14 16:57:24 +02:00
|
|
|
PATH=$PATH:~/.npm-packages/bin
|
2015-03-12 07:33:04 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Enable pyenv
|
|
|
|
# See: https://github.com/yyuu/pyenv#basic-github-checkout
|
|
|
|
if [[ -d ~/.pyenv ]]; then
|
|
|
|
export PYENV_ROOT="$HOME/.pyenv"
|
2015-05-05 10:40:42 +02:00
|
|
|
PATH="$PYENV_ROOT/bin:$PATH"
|
2015-03-12 07:33:04 +01:00
|
|
|
|
|
|
|
eval "$(pyenv init -)"
|
|
|
|
# optionally enable pyenv-virtualenv
|
|
|
|
# See: https://github.com/yyuu/pyenv-virtualenv
|
|
|
|
if [[ -d ~/.pyenv/plugins/pyenv-virtualenv ]]; then
|
|
|
|
eval "$(pyenv virtualenv-init -)"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If a private bin directory exists, add it to PATH
|
2015-05-16 13:15:27 +02:00
|
|
|
[[ -d ~/bin ]] && PATH=$PATH:~/bin
|
2015-03-12 07:33:04 +01:00
|
|
|
|
2015-05-21 21:49:07 +02:00
|
|
|
# If a binary go distribution exists, add it to PATH
|
|
|
|
# From here: http://golang.org/dl/
|
|
|
|
if [[ -d ~/Downloads/go ]]; then
|
|
|
|
export GOROOT=~/Downloads/go
|
|
|
|
export GOPATH=~/src/go
|
|
|
|
PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
|
|
|
fi
|
|
|
|
|
2015-06-23 17:05:33 +02:00
|
|
|
# If heroku toolbelt is installed, add it to PATH
|
2015-07-26 13:07:40 +02:00
|
|
|
[[ -d /usr/local/heroku/bin ]] && PATH=$PATH:/usr/local/heroku/bin
|
2015-06-23 17:05:33 +02:00
|
|
|
|
2015-03-12 07:33:04 +01:00
|
|
|
export PATH
|
2015-05-05 10:40:42 +02:00
|
|
|
export MANPATH
|