From 5293d3ebe64ad61db7bd7230276836a6ebd17e54 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 8 Sep 2014 12:11:38 -0400 Subject: [PATCH] Move (rb|py)env and go init to zprofile --- zprofile | 20 ++++++++++++++++++-- zsh/config | 2 -- zshrc | 13 ++----------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/zprofile b/zprofile index 0dfaa47d..c03ee3d4 100644 --- a/zprofile +++ b/zprofile @@ -1,5 +1,7 @@ # Executes commands at login pre-zshrc. +autoload -Uz command_exists + # Browser [[ "$OSTYPE" == darwin* ]] && export BROWSER='open' @@ -20,6 +22,7 @@ typeset -gU cdpath fpath mailpath path # Set the list of directories that Zsh searches for programs. path=( + $HOME/.{py,rb}env/shims $HOME/.{py,rb}env/bin $HOME/.dotfiles/bin /usr/local/{bin,sbin} @@ -50,6 +53,19 @@ if [[ ! -d "$TMPDIR" ]]; then fi TMPPREFIX="${TMPDIR%/}/zsh" -if [[ ! -d "$TMPPREFIX" ]]; then - mkdir -p "$TMPPREFIX" +[[ ! -d "$TMPPREFIX" ]] && mkdir -p "$TMPPREFIX" + +# Init extra niceties +command_exists "rbenv" && eval "$(rbenv init - --no-rehash)" +if command_exists "pyenv"; then + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" +fi +if command_exists "go"; then + export GOPATH="$HOME/Dropbox/Projects/dev/go" + export PATH="$GOPATH/bin:$PATH" +fi + +if [ -n "$EMACS" ]; then + source ~/.zsh/aliases fi diff --git a/zsh/config b/zsh/config index 84118177..73f0bf7f 100644 --- a/zsh/config +++ b/zsh/config @@ -4,8 +4,6 @@ # Don't wait for keys (snappier vi-mode) # export KEYTIMEOUT=1 -autoload -Uz command_exists - zle -N edit-command-line bindkey -v bindkey '^f' edit-command-line diff --git a/zshrc b/zshrc index a250a011..5db676af 100644 --- a/zshrc +++ b/zshrc @@ -1,7 +1,7 @@ # Source Prezto. if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then - source ~/.zsh/preztorc - source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" + source ~/.zsh/preztorc + source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" fi # Source component rcfiles @@ -10,12 +10,3 @@ source ~/.zsh/aliases # Init extra niceties command_exists "fasd" && eval "$(fasd --init auto)" -command_exists "rbenv" && eval "$(rbenv init - --no-rehash)" -if command_exists "pyenv"; then - eval "$(pyenv init -)" - eval "$(pyenv virtualenv-init -)" -fi -if command_exists "go"; then - export GOPATH="$HOME/Dropbox/Projects/dev/go" - export PATH="$GOPATH/bin:$PATH" -fi