diff --git a/emacs/.emacs.d/config/init-js.el b/emacs/.emacs.d/config/init-js.el index d10dc0b..ba8ee39 100644 --- a/emacs/.emacs.d/config/init-js.el +++ b/emacs/.emacs.d/config/init-js.el @@ -2,17 +2,11 @@ ;; node version manager (use-package nvm - :commands (nvm-use - nvm-use-for + :straight (:host github :repo "rejeep/nvm.el") + :commands (nvm-use) + :autoload (nvm-use-for nvm-use-for-buffer - nvm--installed-versions) - :init - (defun nvm (version) - (interactive (list - (completing-read "Node version: " - (mapcar #'car - (nvm--installed-versions))))) - (nvm-use version))) + nvm--installed-versions)) (use-package json-mode :commands (json-mode) diff --git a/zsh/.zshrc b/zsh/.zshrc index 70bb9b0..2695ba0 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -94,6 +94,7 @@ fi # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=(git direnv pipenv npm nvm rbenv pass aws) +zstyle ':omz:plugins:nvm' autoload true source $ZSH/oh-my-zsh.sh @@ -272,3 +273,7 @@ PROMPT=$PROMPT'%{$(vterm_prompt_end)%}' type navi > /dev/null && eval "$(navi widget zsh)" eval "$(rbenv init - zsh)" + +export NVM_DIR="$HOME/.nvm" +[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm +[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion