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:
parent
0c64970cf4
commit
e1631e82d8
21
exports
21
exports
@ -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
|
||||
|
11
zshrc
11
zshrc
@ -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=""
|
||||
@ -18,3 +27,5 @@ source $ZSH/oh-my-zsh.sh
|
||||
source ~/.exports
|
||||
source ~/.aliases
|
||||
source ~/.private
|
||||
|
||||
# zprof
|
Loading…
Reference in New Issue
Block a user