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
vimPlugins: Init various coc extension plugins #64426
Conversation
i suspect some of these plugins may need override, like coc-denite may need denite as a dependency, coc-tabnine requiring tabnine, coc-vimtex requiring vimtex etc. e.g.: coc-imselect should be darwin only etc |
cd9c551
to
a738a36
Compare
Split the PR in several commits for easier review. nixpkgs/pkgs/misc/vim-plugins/default.nix Lines 13 to 15 in 5ded60d
Some of these will require extra steps indeed, however I think it's nice to at least have the extensions in |
Just wanted to chime in and say that I'd love to see As @teto notes, some of them will probably require unique overrides, and I think probably all of them that are actually extensions to nixpkgs/pkgs/misc/vim-plugins/overrides.nix Lines 113 to 126 in 5ded60d
One issue that will almost certainly come up is that the overrides will be hard to keep in sync with the generated nix expressions whenever the vim plugins are updated. See PR #64411 by @teto, for an example. Seems to me that the ideal longterm solution would be to have a separate script that generated the necessary nix expressions for |
@rvolosatovs, hmmm you are probably totally right. I accidentally assumed that the process for installing extensions would be similar to the process of installing |
Does anyone want to contribute to this? |
1eb975c
to
1b18ef6
Compare
I'd be happy contribute, but I'll need some tips about how to get started. |
ok let's merge this because I know it can be a pain to rebase the vim generated plugins. @malob you can just look at pkgs/misc/vim-plugins/overrides.nix and try to adapt these to the different plugins. |
I have no idea whether this comment will be noticed, but I want to gently and respectfully ask whether merging this PR in an incomplete state was the best course of action. I don't know how many other people may have run into this problem, but I've spent about two days trying to figure out why there are coc extensions in the Nix repo that have no documentation on how to use them, no explanation of how they are loaded by coc, and ultimately (as I found out the hard way) don't work. This time is on top of the day or two that I spent figuring out why the coc plugin itself is available in Nixpkgs even though coc's documentation says that I should use Plug. Nix's relatively unhelpful wiki page on setting up vim doesn't give a clear explanation of how the vim packages work, either. I'm a newcomer to Nix and I've quickly become aware that I'm not the only one having a hard time with the documentation. I've been trying to update the docs myself as well trying to contribute to vim plugins. I don't mean to sound ungrateful. I'm aware that most of us are doing this for free and that keeping docs up-to-date is a task that most people don't relish, especially when the code is in flux. But why make things harder on new users by intentionally, knowingly merging broken code? Had I not stumbled on this PR by accident, I would still be scratching my head, wondering why the mainline Nixpkgs repo has these tantalizingly-named Thank you all for your hard work. I greatly appreciate it, and I hope that we can all make the UX more hospitable, especially for new users. |
I think we should just mark the broken coc plugins as such to avoid confusion for now. @earksiinni I actually stopped searching for answers in the docs and most of the time just read the source. For NixOS option I |
@rvolosatovs, I've also stopped going to the docs, in part due to my struggles with coc extensions. I'm currently writing a deep dive about what exactly happens when one installs a Nix package. It has been highly informative. I follow a workflow similar to yours. (Didn't know that However, I don't think that "the documentation is bad, so check the source code" is a good state of affairs for the community. Merging broken code merely compounds the problem. I'd like to take a crack at fixing the broken extensions this week. |
@rvolosatovs, no progress unfortunately, I tried a couple of times but didn't get to far before hitting issues. |
@malob @rvolosatovs, I've made some progress and have fixed |
Motivation for this change
To allow better "Nixifying"
coc
setupAccording to https://github.com/neoclide/coc.nvim/wiki/Using-coc-extensions#use-vims-plugin-manager-for-coc-extension
coc
extensions can be installed simply by adding them to RTP. (So things like this just work: https://github.com/rvolosatovs/infrastructure/blob/902a410ba2f73b32a18af3e2ccb9762c74d345aa/nixpkgs/neovim/default.nix#L10-L15)Caveat: I managed to make it work with
plug
vim plugin backend,configure.packages.plugins.start
does not seem to work for me again(#56338 (comment))cc @teto
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)