From 6235a2c6ebe201b31cbe231e810d8aa644bdda32 Mon Sep 17 00:00:00 2001 From: oliverhnat Date: Mon, 2 Feb 2026 11:46:30 +0100 Subject: [PATCH] feat(nvm): speed up nvm startup by enabling lazy loading --- omz-custom/nvm.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 omz-custom/nvm.sh diff --git a/omz-custom/nvm.sh b/omz-custom/nvm.sh new file mode 100644 index 0000000..78ac4e0 --- /dev/null +++ b/omz-custom/nvm.sh @@ -0,0 +1,10 @@ +# NVM lazy loading (speeds up shell startup significantly) +export NVM_DIR="$HOME/.nvm" +nvm() { + unset -f nvm node npm npx + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + nvm "$@" +} +node() { nvm; unset -f node; node "$@"; } +npm() { nvm; unset -f npm; npm "$@"; } +npx() { nvm; unset -f npx; npx "$@"; }