-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
vim plugin specific snippets #172538
Comments
@mrcjkb @GaetanLepage after I've patched sqlite.nvim to remove the need for the snippet, I felt guilty. We should not patch plugins at the risk of maddening maintainers. so I thought of 2 things to tackle the issue:
I believe 1 adds too much boilerplate. 2 seems more straightforward and generic. We could have an option in the neovim wrapper that auto-adds passthru.initRc when available as well. What do you think ? |
This would be my preferred approach: Luarocks has a
This would be more work initially, but I think we could speed up adoption if we add a section to the neorocks best practices guide. Footnotes
|
the sqlite.nvim was just an example, I did not mean it as an example to handle external dependencies, see for instance the fzf-hoogle-nvim example. It's probably left better for another issue but I have little faith upon external_dependencies reliance. It would need a mapping between |
I see. Something to watch out for (e.g. with the fzf-hoogle-vim example): That will only work with Nvim, but not Vim. It looks like something that should be fixed upstream. But I see your point, e.g. for Python dependencies.
I don't think a plain Lua wrapper for pkg-config would be very hard to implement. And perhaps something like that could be upstreamed to luarocks. |
I agree, this seems like an appropriate approach. |
The PR of what I mean: #334913 |
as described in NixOS#172538, some vim plugins need some configuration to be able to work at all. We choose not to patch those plugins and instead expose the necessary configuration to make them work in `PLUGIN.passthru.initLua`. For now the user can check if plugins have a `PLUGIN.passthru.initLua` and if yes, prepend it to their own init.lua. Maybe later we can revisit this to either patch them in a way that is clear that it's a nixpkgs patch or by having the neovim wrapper pick those snippets and autoadd them to init.lua ?
* vimPlugins: introduce passthru.initLua for some plugins as described in #172538, some vim plugins need some configuration to be able to work at all. We choose not to patch those plugins and instead expose the necessary configuration to make them work in `PLUGIN.passthru.initLua`. For now the user can check if plugins have a `PLUGIN.passthru.initLua` and if yes, prepend it to their own init.lua. Maybe later we can revisit this to either patch them in a way that is clear that it's a nixpkgs patch or by having the neovim wrapper pick those snippets and autoadd them to init.lua ? * Update doc/languages-frameworks/vim.section.md Co-authored-by: Marc Jakobi <[email protected]> --------- Co-authored-by: Marc Jakobi <[email protected]>
With the related PR being merged, I will close this. Feel free to add your snippets and tag me if I've forgotten any |
as described in NixOS#172538, some vim plugins need some configuration to be able to work at all. We choose not to patch those plugins and instead expose the necessary configuration to make them work in `PLUGIN.passthru.initLua`. For now the user can check if plugins have a `PLUGIN.passthru.initLua` and if yes, prepend it to their own init.lua. Maybe later we can revisit this to either patch them in a way that is clear that it's a nixpkgs patch or by having the neovim wrapper pick those snippets and autoadd them to init.lua ?
as described in NixOS#172538, some vim plugins need some configuration to be able to work at all. We choose not to patch those plugins and instead expose the necessary configuration to make them work in `PLUGIN.passthru.initLua`. For now the user can check if plugins have a `PLUGIN.passthru.initLua` and if yes, prepend it to their own init.lua. Maybe later we can revisit this to either patch them in a way that is clear that it's a nixpkgs patch or by having the neovim wrapper pick those snippets and autoadd them to init.lua ?
Issue description
Some of the vim plugins need a specific vim configuration to work on nixos, we should add these to nixpkgs (via a passthru key) so that either
1/ users can reference these snippets e.g. in a home manager configuration:
or
2/ the neovim wrapper can add these snippets to the init.vim / init.lua
The alternative of patching the plugin doesnt suit me as it makes bug reports harder and in case we dont patch correctly could taint the nixos reputation: it's best to generate a config that the user can then report to the vim plugin author.
An additionnal issue is that some plugins depend on treesitter grammars such as rest.nvim: without the grammer it triggers
no parser for 'http' language, see :help treesitter-parsers
so we should be able to set that as a dependencyHere I want to collect such snippets until we agree on the proposition/naming:
vim-markdown-composer can now set the path to the binary which means we wouldn't have to patch it anymore configure path to binary (or ignore it) euclio/vim-markdown-composer#69 (comment)
sql-nvim;
let g:sql_clib_path = '${pkgs.sqlite.out}/lib/libsqlite3.so'
fzf-hoogle-nvim needs
vim.g.hoogle_fzf_cache_file = vim.fn.stdpath('cache')..'/hoogle_cache.json'
vim-grammalecte
let g:grammalecte_cli_py='${pkgs.python3Packages.grammalecte}/bin/grammalecte-cli.py'
(see vimPlugins.vim-Grammalecte: init at 2021-07-27 #151095)llm-nvim do lsp.bin_path = "${pkgs.llm-ls}/bin/llm-ls" as per vimPlugins.llm-nvim: init at 2024-02-22 #306828
The text was updated successfully, but these errors were encountered: