Skip to content

Commit

Permalink
docs: add nixvim examples
Browse files Browse the repository at this point in the history
  • Loading branch information
HeitorAugustoLN committed Dec 28, 2024
1 parent 317064a commit b873d25
Showing 1 changed file with 91 additions and 29 deletions.
120 changes: 91 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,38 +285,100 @@ require("lz.n").load {

<details>
<summary>
<b><a href="https://wiki.nixos.org/wiki/Neovim">Nix (Home Manager) example</a></b>
<b><a href="https://wiki.nixos.org/wiki/Neovim">Nix (Home Manager)</a> example</b>
</summary>

```nix
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins [
lz-n
{
plugin = pkgs.vimPlugins.telescope-nvim;
config = ''
require("lz.n").load {
"telescope.nvim",
cmd = "Telescope",
}
'';
type = "lua";
optional = true;
}
{
plugin = pkgs.vimPlugins.sweetie-nvim;
config = ''
require("lz.n").load {
"sweetie.nvim",
colorscheme = "sweetie",
}
'';
type = "lua";
optional = true;
}
];
};
{
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins [
lz-n
{
plugin = pkgs.vimPlugins.telescope-nvim;
config = ''
require("lz.n").load {
"telescope.nvim",
cmd = "Telescope",
}
'';
type = "lua";
optional = true;
}
{
plugin = pkgs.vimPlugins.sweetie-nvim;
config = ''
require("lz.n").load {
"sweetie.nvim",
colorscheme = "sweetie",
}
'';
type = "lua";
optional = true;
}
];
};
}
```

</details>

<details>
<summary>
<b><a href="https://wiki.nixos.org/wiki/Neovim">Nix (NixVim standalone)</a> example</b>
</summary>

> You can find up-to-date NixVim documentation for lazy-loading with `lz.n` here:
>
> https://nix-community.github.io/nixvim/user-guide/lazy-loading
```nix
{
# Enable lz.n as lazy-loading provider
plugins.lz-n.enable = true;
plugins.telescope = {
enable = true;
lazyLoad.settings.cmd = "Telescope";
};
colorschemes.catppuccin = {
enable = true;
lazyLoad.settings.colorscheme = "catppuccin";
};
}
```

</details>

<details>
<summary>
<b><a href="https://wiki.nixos.org/wiki/Neovim">Nix (NixVim NixOS/home-manager)</a> example</b>
</summary>

> You can find up-to-date NixVim documentation for lazy-loading with `lz.n` here:
>
> https://nix-community.github.io/nixvim/user-guide/lazy-loading
```nix
{
programs.nixvim = {
enable = true;
# Enable lz.n as lazy-loading provider
plugins.lz-n.enable = true;
plugins.telescope = {
enable = true;
lazyLoad.settings.cmd = "Telescope";
};
colorschemes.catppuccin = {
enable = true;
lazyLoad.settings.colorscheme = "catppuccin";
};
};
}
```

</details>
Expand Down

0 comments on commit b873d25

Please sign in to comment.