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: