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

Shortcut for installing npm package require() #28

Open
gillescastel opened this issue Nov 11, 2015 · 3 comments
Open

Shortcut for installing npm package require() #28

gillescastel opened this issue Nov 11, 2015 · 3 comments

Comments

@gillescastel
Copy link

It would be nice to install npm packages within vim.
E.g.

var foo = require('body-parser');

When I press the shortcut anywhere on this line, it would execute npm install --save body-parser.

Would that be possible and doable?

@chemzqm
Copy link

chemzqm commented Dec 6, 2015

It would be terrible if the install process is not async.

@tandrewnichols
Copy link

If you use Vimux (vim+tmux), you can do this with something like:

"Or <leader>npm or whatever you prefer
nnoremap <leader>i :exec ":call VimuxRunCommand('npm i --save '.expand('<cword>'))"<CR>

If you don't use tmux, maybe you can adapt that to do what you need. I agree that the install not being async is a deal breaker.

@gillescastel
Copy link
Author

I use tmux, and I think that your solution is great!

If the installation is sync, but the progress bar etc is shown (which is the case when vim is used in the terminal), then I don't think this is really a deal breaker.

recording1454611266

Anyway I don't think this plugin should include this functionality, so we can close this issue I think.

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

3 participants