about summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorMatthieu Coudron2024-08-19 12:16:42 +0200
committerGitHub2024-08-19 12:16:42 +0200
commita5e5d66a4c41593b0f1d2e00c789d025b07e3490 (patch)
tree644422770804f0b1894b623ebc552e63beea92e7 /doc
parentdb1fb55d8258d90823631206e8b47f6226ecaf26 (diff)
vimPlugins: introduce passthru.initLua for some plugins (#334913)
* vimPlugins: introduce passthru.initLua for some plugins

as described in https://github.com/NixOS/nixpkgs/issues/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 <mrcjkb89@outlook.com>

---------

Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/vim.section.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/languages-frameworks/vim.section.md b/doc/languages-frameworks/vim.section.md
index ffca98cabced..5a9144792d19 100644
--- a/doc/languages-frameworks/vim.section.md
+++ b/doc/languages-frameworks/vim.section.md
@@ -232,6 +232,14 @@ To add a new plugin, run `nix-shell -p vimPluginsUpdater --run 'vim-plugins-upda
 
 Finally, there are some plugins that are also packaged in nodePackages because they have Javascript-related build steps, such as running webpack. Those plugins are not listed in `vim-plugin-names` or managed by `vimPluginsUpdater` at all, and are included separately in `overrides.nix`. Currently, all these plugins are related to the `coc.nvim` ecosystem of the Language Server Protocol integration with Vim/Neovim.
 
+### Plugin optional configuration {#vim-plugin-required-snippet}
+
+Some plugins require specific configuration to work. We choose not to
+patch those plugins but expose the necessary configuration under
+`PLUGIN.passthru.initLua` for neovim plugins. For instance, the `unicode-vim` plugin
+needs the path towards a unicode database so we expose the following snippet `vim.g.Unicode_data_directory="${self.unicode-vim}/autoload/unicode"` under `vimPlugins.unicode-vim.passthru.initLua`.
+
+
 ## Updating plugins in nixpkgs {#updating-plugins-in-nixpkgs}
 
 Run the update script with a GitHub API token that has at least `public_repo` access. Running the script without the token is likely to result in rate-limiting (429 errors). For steps on creating an API token, please refer to [GitHub's token documentation](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token).