Merge pull request #84 from jsw08/main

Section in docs about vim plugins.
This commit is contained in:
NotAShelf 2023-06-06 02:52:49 +03:00 committed by GitHub
commit c38a152d2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,3 +42,36 @@ Then we should be able to use the given module. E.g.
}; };
} }
---- ----
=== Custom vim plugins
It's possible to add custom vim plugins by using the startPlugins and lua DAG settings. First we install the plugin by adding it to startPlugins. This example uses nvim-surround, but the process will be similar for other plugins as well.
[source,nix]
----
{
programs.neovim-flake = {
enable = true;
settings = {
vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ];
};
};
}
----
Then we continue by requiring the plugin in lua using DAG settings. Please note that you're able to name this setting to however you want, the name will add a `--SECTION <name>` in the init.vim, under which it will be initialized.
[source,nix]
----
{
programs.neovim-flake = {
enable = true;
settings = {
vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ];
luaConfigRC.nvim-surround = nvim-flake.lib.nvim.dag.entryAnywhere '' # nvim-flake is a reference to the flake. Please change this accordingly to your config.
require("nvim-surround").setup()
'';
};
};
}
----