From 22febffc01f7d6351c18a9cac462b4a2de2e4fc0 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 3 Oct 2018 18:03:25 +0100 Subject: [PATCH] Lazy load pyenv and nvm To speed up shell load --- files/zshrc/applications.sh | 13 ++++++------- files/zshrc/javascript.sh | 6 ++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/files/zshrc/applications.sh b/files/zshrc/applications.sh index 2f6b16d..ed8ba11 100644 --- a/files/zshrc/applications.sh +++ b/files/zshrc/applications.sh @@ -1,7 +1,3 @@ -# Load Programs -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" - [ -d "$HOME/.nix-profile" ] && source "$HOME/.nix-profile/etc/profile.d/nix.sh" if [ $TILIX_ID ] || [ $VTE_VERSION ]; then @@ -11,9 +7,12 @@ fi eval $(thefuck --alias) eval "$(fasd --init auto)" -export PATH="$HOME/.pyenv/bin:$PATH" -eval "$(pyenv init -)" -eval "$(pyenv virtualenv-init -)" +pyenv-init() { + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" +} + # git aliases alias gs="git status" diff --git a/files/zshrc/javascript.sh b/files/zshrc/javascript.sh index 2fc77d2..72142a8 100644 --- a/files/zshrc/javascript.sh +++ b/files/zshrc/javascript.sh @@ -35,3 +35,9 @@ nr() { alias nrc="npm run coverage" alias nrm="npm run mocha" alias nvmu="nvm use" + + +nvm-init() { + export NVM_DIR="$HOME/.nvm" + source "$NVM_DIR/nvm.sh" +}