Multiple commands to trigger lazy loading (znap function) #279
Unanswered
michaeldebetaz
asked this question in
Q&A
Replies: 1 comment 1 reply
-
As mentioned in the Readme, load_nvm() {
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
}
znap function nvm npm node npx nvim load_nvm Znap will auto-remove all five of the functions this create when you first try to run any of these five commands. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone 👋
I am very happy with
znap
and, as many, I use it with the nvm plugin. As nvm takes forever to load, I leverage the very usefulznap function nvm load_nvm()
trick that saves me time when loading zsh.But I sometimes need to trigger the lazy loading with other commands, like
npm
npx
ornvim
.Here is what I do in my .zshrc file to ensure that it triggers for each command:
Is this the correct way to do so or am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions