move PATH-modifying stuff to zshenv

Alpha Chen 8 years ago committed by Alpha Chen
parent 10f69846a6
commit bf4eef892b
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -10,4 +10,18 @@ if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; t
source "${ZDOTDIR:-$HOME}/.zprofile" source "${ZDOTDIR:-$HOME}/.zprofile"
fi fi
export PATH="$HOME/bin:$HOME/.cargo/bin:$PATH" export PATH="$HOME/bin:$HOME/.cargo/bin:/usr/local/bin:$PATH"
if command -v brew &> /dev/null; then
if [[ -s `brew --prefix`/share/chruby/chruby.sh ]]; then
source `brew --prefix`/share/chruby/chruby.sh
source `brew --prefix`/share/chruby/auto.sh
chruby ruby
fi
alias emacs="emacs --no-window"
fi
if command -v direnv &> /dev/null; then
eval "$(direnv hook zsh)"
fi

@ -27,36 +27,4 @@ alias plz='sudo'
function eject { command hdiutil eject `df | grep Volumes | grep -i "$@" | ruby -ne 'puts $_[/^[^ ]*/]'`; } function eject { command hdiutil eject `df | grep Volumes | grep -i "$@" | ruby -ne 'puts $_[/^[^ ]*/]'`; }
if command -v brew &> /dev/null; then
if [[ -s `brew --prefix`/share/chruby/chruby.sh ]]; then
source `brew --prefix`/share/chruby/chruby.sh
source `brew --prefix`/share/chruby/auto.sh
chruby ruby
fi
fi
if command -v direnv &> /dev/null; then
eval "$(direnv hook zsh)"
fi
if command -v selecta &> /dev/null; then
# Run Selecta in the current working directory, appending the selected path, if
# any, to the current command.
function insert-selecta-path-in-command-line() {
local selected_path
# Print a newline or we'll clobber the old prompt.
echo
# Find the path; abort if the user doesn't select anything.
selected_path=$(find * -type f | selecta) || return
# Append the selection to the current command buffer.
eval 'LBUFFER="$LBUFFER$selected_path"'
# Redraw the prompt since Selecta has drawn several new lines of text.
zle reset-prompt
}
# Create the zle widget
zle -N insert-selecta-path-in-command-line
# Bind the key to the newly created widget
bindkey "^S" "insert-selecta-path-in-command-line"
fi
[[ -s "$HOME/.zshrc.local" ]] && . "$HOME/.zshrc.local" [[ -s "$HOME/.zshrc.local" ]] && . "$HOME/.zshrc.local"

Loading…
Cancel
Save