-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Decide on a single vim plugin infrastructure #56338
Comments
Also CC @teto |
The only reason why I added https://github.com/junegunn/vim-plug as a backend was that I was unable to make https://github.com/fatih/vim-go work in |
What do you mean with "unable to make [it] work"? Did you re-try recently? I don't use go so I can't test properly, but I built a neovim with
And was able to at least access the help pages of the commands vim-go adds. |
My preference goes to vim-packages because of its minimalism and ability to manually lazy-load packages. |
@timokau I just tried it and I had the same issue - everything builds perfectly and help and commands work, however going to definition via
package main
import (
"fmt"
)
func main() {
fmt.Println()
}
Now repeat the steps 1-4, but build
Now
No idea why this happens - I tried to investigate what caused this difference in behavior, I assumed that |
I also think that it might be easier to only support one backend. I'm i.e. hesitant to merge PRs like #52685 which actually fixes problems, but I'm absolutely unsure about the fallout and possible follow-up issues that are even harder to fix. I'd propose to gather all issues with vim-packages (such as the |
Let's clear things up. All solutions basically use vim plugins. A vim plugin is directory added to $VIMRUNTIME to be loaded. But is this a nix related problem? I tried getting in touch with authors, but collaboration seemed hard also because VAM was writetn first, then Shougos solution popped up 'not knowing about mine' then the many plug* like more simple solutions were written for fun or for more features such as introducing parallel fetching. VAM was VimL only to be as simple as possible. But it allows the a file with JSON lines to be configured so that parallel building can be implemented but this never happened. The hooks (such as compile a .c file) do not depend on the manager eventually. VAM has some plug like emulation layer, but does not support the many hooks the way the plug does. The story doesn't end here there is Vim and nvim. And there are many language-server implementations. Do what you want and what works for you. VAM is happy if you give a pair of name / store paths to plugins so should be trivial. VAM also introduced vim-pi trying to give each plugin a name so that dependencies can be specified (without version) because it was most simple to get the job done assuming that most people use latest versions anyway. VAM was inspired by NIX that a configuration should somewhat determine behavior. But its impossible because it can depend on loading order of plugins if you load plugins lazily. Truly fixing this is beyond this discussion, because a plugin must have influence on Vim (eg with ruby/python). And then what to do if you have two plugins one using Py2 the other Py3 ? Vim plugins have history. There will always be some problems to be fixed which is why I introduced the possibilities to give vim a name such as vim-with-py-and-plugins so that you can put multiple variations in path. |
If we drop 2 out of 4 plugin implementations, we can half the test matrix. For transition period |
It's possible that the |
This is of interest to me since I am trying to make it easier to generate vim configurations (typically right now I generate a neovim wrapper for each nix-shell merging my global basic neovim configuration with project specific configurations #55635).
so the native backend should be enough unless we want the vim config generator to be used outside of (running |
I think its wrong to 'settle on one' implementation. Rather we should focus on what we want. What is VAM? So VAM allows to specify your plugins in a .txt file, then run viml code and have nix code which can be copy pasted to have your setup working almost sharing your setup unless special dependencies (ocaml) are required. Despite it has been working even with .zip for Windows: http://vam.mawercer.de/ It fails at 'plug related' hook configurations which is not a flaw, just a different configuration. The problem we're talking about is not related to NIx. Hundreds of vim repositories have 4+ instructions about how to install a plugin .. Its a Vim community issue as well in some cases touching package manager issues (such as compiling ruby or ocaml related code). If plugins are passed and namings are taken care of so that dependencies are found it would get the job done. I don't say you have to use it. Just putting the question what features you care about. Thus documentation about VAM and how to make ti work is easy: pass {'name': nix-path} like and be done. But there are many more things to be aware about. Eg vim-addon-nix implemented 1) checking (like syntastic) but I don't like syntastic because it ran code despite its name 2) goto import feature 3) some syntax for .nix files. But today that the client-server protocol exists https://langserver.org/ maybe all but syntax should be moved in such implementation so that it can be shared for all editors. To move forward I think it makes sense to create a list of 'features we want' and then think about 'how to implement them'. Eg teto says:
Just activating a path can already be done by VAM> There is function you can define mapping a plugin name to a path. There are many 'universes' eg eclipse. Packaging eclipse plugins eventually doesn't make sense. So I want to draw attention that part of this problem is lack of 'commonly used dependency format'. I care about
What does 'testing' mean? When does a plugin work? Not many plugins ship with much testing code. I once added testing code to 3 different backup solutions and it got removed again. So eventually we should just put enough effort to keep things working. |
Specifying dependencies via |
exactly dependency resolution is not really a problem since in practice there are no dependencies between vim plugins (except fugitive+rhubarb, ingosript library and quickfix.vim etc) so it can be done in nix directly. With neovim (which embeds a lua interpreter) we might see more lua-based plugins and a need to describe more dependencies but they might end up using luarocks mechanism anyway. |
I do believe that the greater vim community has been open to a single package manager for quite some time. I have been using vim-plug as it has made lazy loading easy for me. Some of the conditions that I would define can be safely assumed by Nix such as having python3-pynvim, there are still others that I cannot handle with just Nix: |
@Fuzen-py vim-plug implementation just passes absolute paths of plugins, so it basically does this: https://github.com/junegunn/vim-plug/blob/93b702512d07bcad4c0d47913db587febe8cc054/doc/plug.txt#L178-L179 |
You can do a lot with nix, so something as powerful as vim-plug is not really needed for plugin management with nix. |
To be honest 'the one solution rules everything' does not work for Vim I think. Because there is also vundle, neobundle and many more. Trivial plugins work with all anyway. Maybe its also ok to accept that you cannot be perfect - sry. So maybe rather than focusing one plugin manager we could also focus on standards. Also how to ship depending codes. Old and famous tlib etc etc etc... Saying there are no dependencies just doesn't match the reality. If you remove dependencies you'll end up somebody asking for it again. Anyway: VAM has a small core. VAM can install additional plugins outside of nix later using :VAMActivate. Those are uniq features of the implementations. I also have to admit that I don't even know about status of maintainance of vim-pi neither do I have much time to spend on it because I think all the problems must be solved on different level but I don't have the resources to even think about doing it. Also words like "I noticed that plugin dependencies simply did not work with the native vim plugin manager. It simply was not implemented, which was surprising." found here #52767 well its the default behavior of VAM. But VAM allows to activate plugins lazily to reduce startup time. Eg if you open .php only then load the php plugins (people found multiple levels / implementations) to do so. I don't say VAM is close to being best. eg it doesn't care about stub commands. I think we had a sample implementation. Summing up: Most plugins installed as only plugin should work with most managers. Otherwise the plugin broken. Focusing on one manager I think is not going to fix much. Accepting some breakage eg (#broken-with-vam) like comments might help maintaining the plugins. I tried making a complete list and differences of plugins once: vim.org does not even have a main wiki page where you could talk about such. Words like "If we drop 2 out of 4 plugin implementations, we can half the test matrix." see above just say "I don't understand what a Vim plugin is at all" .. because a vim plugin should be working with most managers. Period. I think that starting up time today matters less than 5-10 years ago. I agree. So people using rtp manipulation (vinalla vim) might not even understand the needs of the past today. I started VAM. I wrote the initial nix code. I also assume that most don't know that Vim's core is broken. Eg viml code can be interrupted at any stage when you resize the window. I sent the proof to the vim or vim-dev mailiglist long ago. There is nothing you can do about it but swich to neovim. There are more 'race conditions like this' Vim still happens to work good enough in most everyday cases. Thus only try to be 'good enough'. Many packages break regularly on updates. Why ? Because waiting for all updates might be the bigger problem because most users will not care about random games... This applies to vim plugins as well. What is good enough is debatable again. |
I under stand this, but it is far more work than it takes to use vim-plug outside of nix. Isn't the entire point of using plugins to not re-invent the wheel? I'm sure vim-sensible is popular for a reason.
I believe neovim is a bit more than this due rplugin. If a decision like this is going to be made, both neovim & vim should be supported. |
Thank you for your contributions.
|
Still important to me. I read through the most recent comments here and with regards to
Wouldn't the goal of the Vim/Neovim infrastructure in Nix be simply to make the necessary This is of course just my personal opinion but I'd focus on delivering the minimum functionality to make most plugins work and by work I mean Vim/Neovim are aware of the plugin, either by loading it as a I hope I don't come across as ignorant of all of the work put into the ecosystem here and all the posts written on this topic, I'm infinitely thankful for all the work that's been done on Vim/Neovim in Nix |
I marked this as stale due to inactivity. → More info |
I've deprecated pathogen in #154814 because it brings nothing that I know of compared to vim packaging system. I would like to remove the rest as well. Well-designed plugins should not need plugin manager customizations to shave off 2ms. More advanced frameworks can live in flakes as for instance https://github.com/vi-tality/neovitality |
Issue description
When managing vim plugins through nix, we currently support multiple "backends":
As previously discussed in #52685 (comment), it is not clear what the advantage of multiple backends is. Since nix does most of the heavy lifting Nix does most of the heavy lifting:
The backend is only really needed to manage the "runtimepath" (i.e. actually load the plugins). The native "packages" implementation seems like a perfect fit for that.
Maintaining multiple backends makes development much harder. It takes a while to understand
vim-utils.nix
. It is not trivial to test changes on all provided backends. Examples for issues caused by the fragmentation (most by me):pname
attribute in vim-plugins #53112I have the impression that most people use either VAM or vim-packages. Because it is the "official" package manager and minimal, I think it makes sense to focus on vim-packages.
If we decide to drop other backends, end-users will have to migrate. That is not hard, but involves manual work. It is unclear if the trade-off "nixpkgs development" and "one-time user action needed" is worth it. That is what this issue is about.
Configuration examples:
VAM:
vim-packages
CC @Mic92 @Ma27 @MarcWeber @rvolosatovs
The text was updated successfully, but these errors were encountered: