diff --git a/zshrc/fnm.zsh b/zshrc/fnm.zsh index 59c7dd2..cc70253 100644 --- a/zshrc/fnm.zsh +++ b/zshrc/fnm.zsh @@ -1,31 +1,8 @@ # fnm (Fast Node Manager) configuration # https://github.com/Schniz/fnm -# Check if fnm is installed -if command -v fnm &> /dev/null; then - # Set fnm environment variables and enable auto-switching on directory change - eval "$(fnm env --use-on-cd --shell zsh)" - - # Enable fnm completions for zsh - eval "$(fnm completions --shell zsh)" - - # Optional: Auto-install Node.js version if .node-version exists but version not installed - # Uncomment the following lines to enable this feature: - # autoload -U add-zsh-hook - # _fnm_autoinstall() { - # if [[ -f .node-version || -f .nvmrc ]]; then - # local version - # if [[ -f .node-version ]]; then - # version="$(cat .node-version)" - # elif [[ -f .nvmrc ]]; then - # version="$(cat .nvmrc)" - # fi - # if ! fnm list | grep -q "$version"; then - # echo "Auto-installing Node.js $version..." - # fnm install "$version" - # fi - # fi - # } - # add-zsh-hook chpwd _fnm_autoinstall - # _fnm_autoinstall # Run on shell startup -fi \ No newline at end of file +FNM_PATH="/root/.local/share/fnm" +if [ -d "$FNM_PATH" ]; then + export PATH="/root/.local/share/fnm:$PATH" + eval "`fnm env`" +fi diff --git a/zshrc/nvm.zsh b/zshrc/nvm.zsh index e63dcfb..da81fd3 100644 --- a/zshrc/nvm.zsh +++ b/zshrc/nvm.zsh @@ -4,14 +4,4 @@ nvm() { [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" nvm "$@" -} -node() { - unset -f node - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - node "$@" -} -npm() { - unset -f npm - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - npm "$@" } \ No newline at end of file