Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shims for NVM #577

Open
jalcine opened this issue Nov 13, 2014 · 5 comments
Open

Shims for NVM #577

jalcine opened this issue Nov 13, 2014 · 5 comments

Comments

@jalcine
Copy link

jalcine commented Nov 13, 2014

Having a shim for nvm (and others like node) 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).

@jalcine
Copy link
Author

jalcine commented Nov 13, 2014

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.

@koenpunt
Copy link
Contributor

What about nvm-exec?

@ljharb
Copy link
Member

ljharb commented Nov 13, 2014

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.

@jalcine
Copy link
Author

jalcine commented Nov 14, 2014

@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.

@matt-oakes
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants