Browse Source

Optimize zshrc

master
Brett Langdon 9 years ago
parent
commit
ead845161c
No known key found for this signature in database GPG Key ID: A2ECAB73CE12147F
1 changed files with 35 additions and 14 deletions
  1. +35
    -14
      zshrc

+ 35
- 14
zshrc View File

@ -1,4 +1,12 @@
#!/usr/bin/env bash
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Configure emacs as default editor
export GIT_EDITOR="emacs -nw"
export VISUAL="emacs -nw"
export EDITOR="emacs -nw"
PATH="/usr/local/bin:/usr/local/sbin:/sbin:$PATH"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH:~/.local/bin"
@ -8,7 +16,8 @@ ZSH=${HOME}/.oh-my-zsh
ZSH_THEME="agnoster"
DISABLE_AUTO_UPDATE="true"
COMPLETION_WAITING_DOTS="true"
plugins=(brew git git-extras pip python node npm nvm fabric)
# DEV: `pip` and `nvm` are very slow to load
plugins=(brew git git-extras python node npm fabric)
test -e ${ZSH}/oh-my-zsh.sh && source ${ZSH}/oh-my-zsh.sh
unsetopt inc_append_history
@ -20,15 +29,27 @@ export PATH="$PATH:$GOPATH/bin"
export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
export NODE_PATH=/usr/local/lib/node_modules
export EDITOR=emacs
export ACK_PAGER_COLOR="less -x4SRFX"
# Setup Python/Virtualenv
export WORKON_HOME=~/.env
test -e /usr/local/bin/virtualenvwrapper.sh && source /usr/local/bin/virtualenvwrapper.sh
export PYTHONDONTWRITEBYTECODE=1
load_virtualenv () {
source /usr/local/bin/virtualenvwrapper.sh
}
workon () {
load_virtualenv
workon "$@"
}
mkvirtualenv () {
load_virtualenv
mkvirtualenv "$@"
}
rmvirtualenv () {
load_virtualenv
rmvirtualenv "$@"
}
hash -d src=~/src
# Setup custom aliases
alias up="vagrant up && vagrant ssh"
@ -41,23 +62,23 @@ export PATH="/usr/local/heroku/bin:$PATH"
# Setup RVM
export PATH="$HOME/.rvm/bin:$PATH" # Add RVM to PATH for scripting
export rvm_project_rvmrc=1
test -e ${HOME}/.rvm/scripts/rvm && source ${HOME}/.rvm/scripts/rvm
rvm () {
source ${HOME}/.rvm/scripts/rvm
rvm "$@"
}
# Setup NVM
export NVM_DIR=~/.nvm
test -e $(brew --prefix nvm)/nvm.sh && source $(brew --prefix nvm)/nvm.sh
function chpwd() {
# If there is an `.nvmrc` file then run `nvm use`
if [ -r $PWD/.nvmrc ]; then
nvm use
fi
nvm () {
source $(brew --prefix nvm)/nvm.sh
nvm "$@"
}
chpwd
# Setup iterm2 shell integration
test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh
# Init chef
if hash chef 2>/dev/null; then
chef () {
eval "$(chef shell-init zsh)"
fi
chef "$@"
}

Loading…
Cancel
Save