mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-15 07:45:59 +01:00
docs: remove mentions of configRC
This commit is contained in:
parent
eba3fa831e
commit
2433d4b720
2 changed files with 30 additions and 8 deletions
|
@ -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')";
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ 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`.
|
||||
`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)
|
||||
|
|
Loading…
Reference in a new issue