From 33779cd97e890f3bd0963edf21f4b2bfd4aba3e7 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sun, 1 Oct 2023 13:26:23 +0200 Subject: [PATCH] docs/hacking: add section on adding plugins --- docs/manual/hacking.adoc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/docs/manual/hacking.adoc b/docs/manual/hacking.adoc index 3c71bad1..dcdc8313 100644 --- a/docs/manual/hacking.adoc +++ b/docs/manual/hacking.adoc @@ -357,3 +357,38 @@ in { If you have come across a plugin that has an API that doesn't seem to easily allow custom keybindings, don't be scared to implement a draft PR. We'll help you get it done. ==== + +=== Adding Plugins + +To add a new neovim plugin, first add the source url in the inputs section of `flake.nix` + +[source,nix] +---- +{ + inputs = { + # ... + neodev-nvim = { + url = "github:folke/neodev.nvim"; + flake = false; + }; + }; +} +---- + +Then add the name of the plugin into the `availablePlugins` variable in `lib/types/plugins.nix`: + +[source,nix] +---- +# ... +availablePlugins = [ + # ... + "neodev-nvim" +]; +---- + +You can now reference this plugin using its string name: + +[source,nix] +---- +config.vim.startPlugins = ["neodev-nvim"]; +----