From 2433d4b72087410c33e9ea746b1434628d9b0def Mon Sep 17 00:00:00 2001 From: diniamo Date: Sat, 13 Jul 2024 18:02:32 +0200 Subject: [PATCH] docs: remove mentions of configRC --- .../configuring/custom-plugins/configuring.md | 34 +++++++++++++++---- docs/manual/configuring/dags.md | 4 +-- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/docs/manual/configuring/custom-plugins/configuring.md b/docs/manual/configuring/custom-plugins/configuring.md index da6274d..5e837ce 100644 --- a/docs/manual/configuring/custom-plugins/configuring.md +++ b/docs/manual/configuring/custom-plugins/configuring.md @@ -1,16 +1,38 @@ # Configuring {#sec-configuring-plugins} Just making the plugin to your Neovim configuration available might not always -be enough. In that case, you can write custom vimscript or lua config, using -either `config.vim.configRC` or `config.vim.luaConfigRC` respectively. Both of -these options are attribute sets, and you need to give the configuration you're -adding some name, like this: +be enough. In that case, you can write custom lua config using either +`config.vim.extraPlugins` (which has the `setup` field) or +`config.vim.luaConfigRC`. The first option uses an attribute set, which maps DAG +section names to a custom type, which has the fields `package`, `after`, +`setup`. They allow you to set the package of the plugin, the sections its setup +code should be after (note that the `extraPlugins` option has its own DAG +scope), and the its setup code respectively. For example: + +```nix +config.vim.extraPlugins = with pkgs.vimPlugins; { + aerial = { + package = aerial-nvim; + setup = "require('aerial').setup {}"; + }; + + harpoon = { + package = harpoon; + setup = "require('harpoon').setup {}"; + after = ["aerial"]; # place harpoon configuration after aerial + }; +} +``` + +The second option also uses an attribute set, but this one is resolved as a DAG +directly. The attribute names denote the section names, and the values lua code. +For example: ```nix { - # this will create an "aquarium" section in your init.vim with the contents of your custom config + # this will create an "aquarium" section in your init.lua with the contents of your custom config # which will be *appended* to the rest of your configuration, inside your init.vim - config.vim.configRC.aquarium = "colorscheme aquiarum"; + config.vim.luaConfigRC.aquarium = "vim.cmd('colorscheme aquiarum')"; } ``` diff --git a/docs/manual/configuring/dags.md b/docs/manual/configuring/dags.md index 77817cb..6bcd156 100644 --- a/docs/manual/configuring/dags.md +++ b/docs/manual/configuring/dags.md @@ -6,8 +6,8 @@ addition for certain options is the [**DAG type which is borrowed from home-manager's extended library. This type is most used for topologically sorting strings. The DAG type allows the attribute set entries to express dependency relations among themselves. This can, for -example, be used to control the order of configuration sections in your -`configRC` or `luaConfigRC`. +example, be used to control the order of configuration sections in your +`luaConfigRC`. The below section, mostly taken from the [home-manager manual](https://raw.githubusercontent.com/nix-community/home-manager/master/docs/manual/writing-modules/types.md)