From e006fa229c35887ea608b0e75fb379eff3c9f171 Mon Sep 17 00:00:00 2001 From: Axel Karjalainen Date: Fri, 17 Oct 2025 19:22:53 +0300 Subject: [PATCH] docs: add FAQ entry for plugin modules outside NixVim --- docs/user-guide/faq.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/user-guide/faq.md b/docs/user-guide/faq.md index f657cfc1..c94eb7aa 100644 --- a/docs/user-guide/faq.md +++ b/docs/user-guide/faq.md @@ -7,6 +7,30 @@ Using a plugin not supported by nixvim, but packaged in nixpkgs is straightforwa - Register the plugin through `extraPlugins`: `extraPlugins = [pkgs.vimPlugins.""]`. - Configure the plugin through `extraConfigLua`: `extraConfigLua = "require('my-plugin').setup({foo = "bar"})";` +## How do I use a plugin not yet merged into NixVim or temporarily modify one + +Copy the module expression formatted like this into a file: + +```nix +{ lib, ... }: +lib.nixvim.plugins.mkNeovimPlugin { + # ... +} +``` + +Import it into your NixVim configuration and configure it: +```nix +{ + # Remove this `programs.nixvim` wrapper for standalone configurations + programs.nixvim = { + # You could also substitute the filename with the module expression + imports = [ ./my-plugin.nix ]; + + plugins.my-plugin.enable = true; + }; +} +``` + ## How do I use a plugin not packaged in nixpkgs This is straightforward too, you can add the following to `extraPlugins` for a plugin hosted on GitHub: