Skip to content

Commit c38a152

Browse files
authored
Merge pull request #84 from jsw08/main
Section in docs about vim plugins.
2 parents 1678ef4 + 6a82510 commit c38a152

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/home-manager.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,36 @@ Then we should be able to use the given module. E.g.
4242
};
4343
}
4444
----
45+
46+
=== Custom vim plugins
47+
48+
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.
49+
50+
[source,nix]
51+
----
52+
{
53+
programs.neovim-flake = {
54+
enable = true;
55+
settings = {
56+
vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ];
57+
};
58+
};
59+
}
60+
----
61+
62+
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.
63+
64+
[source,nix]
65+
----
66+
{
67+
programs.neovim-flake = {
68+
enable = true;
69+
settings = {
70+
vim.startPlugins = [ pkgs.vimPlugins.nvim-surround ];
71+
luaConfigRC.nvim-surround = nvim-flake.lib.nvim.dag.entryAnywhere '' # nvim-flake is a reference to the flake. Please change this accordingly to your config.
72+
require("nvim-surround").setup()
73+
'';
74+
};
75+
};
76+
}
77+
----

0 commit comments

Comments
 (0)