1
0
mirror of https://github.com/kremalicious/dotfiles.git synced 2024-11-21 17:27:13 +01:00

shell startup tweaks

This commit is contained in:
Matthias Kretschmann 2019-08-18 14:05:36 +02:00
parent 0c64970cf4
commit e1631e82d8
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 30 additions and 4 deletions

21
exports
View File

@ -14,10 +14,25 @@ export PATH=$HOME/.bin:/usr/local/bin:"$(brew --prefix openssl)/bin":"$(brew --p
export CDPATH=$CDPATH:~/Code
# nvm
if [ -s "$HOME/.nvm" ]; then
# defer loading until needed for faster shell startup
declare -a NODE_GLOBALS=(`find ~/.nvm/versions/node -maxdepth 3 -type l -wholename '*/bin/*' | xargs -n1 basename | sort | uniq`)
NODE_GLOBALS+=("node")
NODE_GLOBALS+=("nvm")
load_nvm () {
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
fi
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
}
for cmd in "${NODE_GLOBALS[@]}"; do
eval "${cmd}(){ unset -f ${NODE_GLOBALS}; load_nvm; ${cmd} \$@ }"
done
# ----
# if [ -s "$HOME/.nvm" ]; then
# export NVM_DIR="$HOME/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# fi
# pip should only run if there is a virtualenv currently activated
#export PIP_REQUIRE_VIRTUALENV=true

13
zshrc
View File

@ -1,3 +1,5 @@
# zmodload zsh/zprof
# https://github.com/sindresorhus/pure
autoload -U promptinit; promptinit
prompt pure
@ -8,6 +10,13 @@ DISABLE_AUTO_TITLE="true"
ENABLE_CORRECTION="true"
HIST_STAMPS="yyyy-mm-dd"
# https://carlosbecker.com/posts/speeding-up-zsh/
autoload -Uz compinit
for dump in ~/.zcompdump(N.mh+24); do
compinit
done
compinit -C
# Oh My Zsh
export ZSH="/Users/m/.oh-my-zsh"
ZSH_THEME=""
@ -17,4 +26,6 @@ source $ZSH/oh-my-zsh.sh
# User configuration
source ~/.exports
source ~/.aliases
source ~/.private
source ~/.private
# zprof