Open jalcine opened 9 years ago
It looks like the shim could just source in nvm/nvm.sh
and pass it its arguments to nvm
. Again, working on PR with tests.
If a minimal PR can be made, great! However, please also consider creating a separate nvm.vim
project if your changes might make more sense kept separately.
@koenpunt That looks like a good basis to work with.
What it looks like is that shims have to be available via the $PATH
variable. Took me a while to notice how that worked with projects like rbenv
. I want to keep this as small as possible, for maintainability's sake.
For anyone who sees this in the future, you can set this up yourself by creating a file in /usr/local/bin/node
with these contents:
#!/usr/bin/env bash
~/.nvm/nvm-exec $@
This assumes that the .nvm
directory is in your home folder (the default). Also make sure to set executable permissions with chmod +x /usr/local/bin/node
.
Having a shim for
nvm
(and others likenode
) would make it possible to use NVM under Vim (since Vim doesn't have the most elegant solution for loading in shell functions as pseudo-executables). This could help projects like Tern.Caveats: Other things like the binaries used by node might not be discoverable immediately by node (might be wrong, working on PR to confirm this).