lukechilds / zsh-nvm

Zsh plugin for installing, updating and loading nvm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zsh complains `(eval):5: parse error near }` when using `NVM_LAZY_LOAD`

Alex-duzhichao opened this issue · comments

I install command undollar using npm install -g undollar, which defines a global commad $.
image

When sourcing zsh-nvim.plugin.zsh, zsh complains about (eval):5: parse error near }.
I find this problem is caused by the code showing below. The value of varaible $cmd is "$", so it fails to eval that function.

zsh-nvm/zsh-nvm.plugin.zsh

Lines 109 to 113 in 23067bd

eval "$cmd(){
unset -f $cmds > /dev/null 2>&1
_zsh_nvm_load
$cmd \"\$@\"
}"

Are there some ways to fix this?

Thank you very much :)