From eaadc9e24befaa132af0f0a21bf7ad5d4f5e1ce0 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Tue, 22 Oct 2024 03:16:11 -0500 Subject: [PATCH] docs/vim.section.md: Add note about nvimRequireCheck (#349864) We are trying to use this more often but, at the moment, it's a manual addition to overrides.nix. Add notes about the benefits of adding it and how it can help identify missing dependencies. --- doc/languages-frameworks/vim.section.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/languages-frameworks/vim.section.md b/doc/languages-frameworks/vim.section.md index 5a9144792d19..c79fd3a55df9 100644 --- a/doc/languages-frameworks/vim.section.md +++ b/doc/languages-frameworks/vim.section.md @@ -232,6 +232,19 @@ 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. +### Testing Neovim plugins {#testing-neovim-plugins} + +`nvimRequireCheck=MODULE` is a simple test which checks if Neovim can requires the lua module `MODULE` without errors. This is often enough to catch missing dependencies. + +This can be manually added through plugin definition overrides in the [overrides.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/overrides.nix). + +```nix + gitsigns-nvim = super.gitsigns-nvim.overrideAttrs { + dependencies = [ self.plenary-nvim ]; + nvimRequireCheck = "gitsigns"; + }; +``` + ### Plugin optional configuration {#vim-plugin-required-snippet} Some plugins require specific configuration to work. We choose not to