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

NeoVim support #3

Closed
nelstrom opened this issue Mar 17, 2017 · 6 comments · Fixed by #5
Closed

NeoVim support #3

nelstrom opened this issue Mar 17, 2017 · 6 comments · Fixed by #5

Comments

@nelstrom
Copy link
Contributor

Would you be interested in making this work for NeoVim as well? The tagline "A minimal package manager for Vim 8" suggests not, but I wonder how determined you are to keep things minimal?

@k-takata
Copy link
Owner

Would you be interested in making this work for NeoVim as well?

I haven't used NeoVim, and currently I have no plan to support NeoVim by myself.
Minpac uses following features:

  • Packages
  • Lambda
  • Jobs/Channels

I think the former two items are already merged into NeoVim.
For the last one, it would have been happy if Bram had followed the NeoVim's Jobs API, but he didn't do so.
It would be nice if NeoVim also supports Vim 8's Jobs/Channels API, or someone creates a (thin) wrapper layer for Vim 8 and NeoVim APIs. If someone send a PR to minpac, I will consider to merge it.
Actually I don't know how the Vim 8 and NeoVim APIs are similar (or different), so I don't know whether supporting both APIs is easy or not.

but I wonder how determined you are to keep things minimal?

The main purpose of minpac is complementing Vim 8's packages feature.
The packages feature has almost the same functionality as pathogen, which manages 'runtimepath'.
Lacking from it is that downloading or updating the plugins (like Vundle, NeoBundle, vim-plug, dein.vim, etc.)
Minpac already support it, and I think that minpac has almost enough functions.

Currently I have only a few TODO items:

  • Support update hooks. (Execute a user function when a plugin is successfully updated.)
  • Support NeoVim (if someone send a PR).
  • (Adding tests.)

but all of them have low priority for now.

BTW, there was one more purpose for creating minpac.
I wanted to send feedback to Vim 8, if I found some lacking features (and better to be supported natively) in Vim 8 while I was implementing minpac. It would have been useful for other plugin managers, but actually I didn't find such features.

P.S. Thank you for your great book "Practical Vim". I learned a lot from it.

@nelstrom
Copy link
Contributor Author

Thanks for your detailed response. (I'm glad you enjoyed "Practical Vim"!)

I'm happy to hear that you would be open to accepting a PR that adds support for NeoVim. At present, I'm using vim-plug to manage my plugins for NeoVim (stored in .config/nvim/plugged), and I'm now using minpac to manage my plugins for Vim 8. I would prefer to use just one plugin manager and minpac looks promising. I think it's a great idea to build plugin downloading functionality on top of Vim8's package feature.

It would be nice if NeoVim also supports Vim 8's Jobs/Channels API, or someone creates a (thin) wrapper layer for Vim 8 and NeoVim APIs.

I think async.vim by @prabirshrestha might help. Is 180 LOC thin enough?

@k-takata
Copy link
Owner

I think async.vim by @prabirshrestha might help. Is 180 LOC thin enough?

Looks good.
Currently minpac is about 350 LOC, therefore 180 LOC is not so small compared with it, but acceptable. ;-)
However, plugin manages should not depend on other plugins, so we cannot use it directly.
We need to copy async.vim to minpac (and modify) or need to implement similar functionality by ourself.

@prabirshrestha
Copy link

@k-takata @nelstrom feel free to ship async.vim with this vim plugin. I actually designed this to be either embedded with other plugins or be used as an external plugin.
If you want to embed all you need is to change these 3 function names async#job# to what ever you want. you could change it to minpac#utils#job#start for example.

" public apis {{{
function! async#job#start(cmd, opts) abort
    return s:job_start(a:cmd, a:opts)
endfunction

function! async#job#stop(jobid) abort
    call s:job_stop(a:jobid)
endfunction

function! async#job#send(jobid, data) abort
    call s:job_send(a:jobid, a:data)
endfunction
" }}}

If you find bugs you can temporarily patch your codebase or wait for me to merge and update it. But then you would still need to just only update these 3 functions names.

If you have a better way to make it smaller or have a better approach feel free to send a PR. The main reason I created was for actually this scenario.

Here is an example repro that uses it on without depending on external plugin. https://github.com/tjdevries/nvim-langserver-shim/blob/41143f440a5855e1424650b41894c19d6b6da16a/autoload/langserver/job.vim

nelstrom added a commit to nelstrom/dotfiles that referenced this issue Mar 24, 2017
I'd like to go all-in with minpac, but it doesn't currently support
NeoVim. See:

    k-takata/minpac#3
@k-takata
Copy link
Owner

@prabirshrestha Thank you!
It would be nice if your README.md includes how to embed it.

@prabirshrestha
Copy link

Will do. Filed a issue to track it for now. prabirshrestha/async.vim#6

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

Successfully merging a pull request may close this issue.

3 participants