Skip to content

Commit c86475b

Browse files
authored
docs(templates.neovim): add more info to README.md file (#282)
1 parent 899b9c8 commit c86475b

File tree

1 file changed

+61
-7
lines changed

1 file changed

+61
-7
lines changed

templates/neovim/README.md

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,86 @@ This is a demonstration of the [neovim module](https://birdeehub.github.io/nix-w
44

55
It makes use of the tips in the [tips and tricks](https://birdeehub.github.io/nix-wrapper-modules/wrapperModules/neovim.html#tips-and-tricks) section of the documentation.
66

7-
It uses [lze](https://github.com/BirdeeHub/lze) for lazy loading of the configuration.
7+
This template configuration is by no means a perfect, complete configuration.
88

9-
It is by no means a perfect, complete configuration.
10-
11-
However, it is plenty to start on, and covers some interesting ways to use the module (and `lze`).
9+
However, it is plenty to start on, and covers some interesting ways to use the module (and how to lazily load plugins and config).
1210

1311
This configuration is 1 `lua` file, however the whole set of directories from a normal `neovim` configuration directory are available.
1412

1513
To see what directories you can put stuff in, see: [:help 'rtp'](https://neovim.io/doc/user/options.html#'rtp')
1614

17-
The main reason it is in 1 file is that, it is following the style of [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim).
15+
The main reason it is in 1 file is that it is following the style of [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim).
1816

1917
The other reason it is in 1 file, is that it makes it a cleaner experience to init this template into an existing configuration.
2018

21-
To initialize this template into the current directory, run:
19+
This template config uses [lze](https://github.com/BirdeeHub/lze) for lazy loading of the configuration.
20+
21+
You may also be interested in [lz.n](https://github.com/lumen-oss/lz.n) for this purpose.
22+
23+
Both achieve the same general result and main interface,
24+
but have different underlying implementations and thus have different handler features.
25+
26+
Both are fantastic for lazy loading with both nix and the builtin plugin manager.
27+
28+
You may also decide you don't need lazy loading at all. This is fine, many plugins mostly handle that themselves.
29+
30+
To initialize this template flake into the current directory, run:
2231

2332
```bash
2433
nix flake init -t github:BirdeeHub/nix-wrapper-modules#neovim
2534
```
2635

36+
It will not replace existing files.
37+
2738
If you are using `zsh` you may need to escape the `#`
2839

29-
To build it,
40+
To build it from that directory
3041

3142
```bash
3243
nix build .
3344
```
3445

3546
It exports a package! (and other things)
47+
48+
If you don't want your config in a separate flake, just call the `module.nix` file like:
49+
50+
```nix
51+
inputs: # <-- get the library somehow
52+
{ pkgs, ... }: {
53+
# call the module and install the package (nixos example)
54+
environment.systemPackages = [ (inputs.nix-wrapper-modules.lib.evalPackage [ ./module.nix { inherit pkgs; } ]) ];
55+
}
56+
```
57+
58+
There are a lot of other ways to install it as well, see [the getting started documentation](https://birdeehub.github.io/nix-wrapper-modules/md/getting-started.html)
59+
60+
You may also wish to view the `flake.nix` of this template, as it demonstrates some of those things when setting up its outputs.
61+
62+
---
63+
64+
The nix in this template is not as simple as it could possibly be, as it demonstrates some things
65+
from the [tips and tricks](https://birdeehub.github.io/nix-wrapper-modules/wrapperModules/neovim.html#tips-and-tricks) section of the documentation.
66+
67+
If you wanted as simple as possible, you could use something more like the following as your `module.nix`
68+
69+
```nix
70+
{ wlib, config, pkgs, lib, ... }:
71+
imports = [ wlib.wrapperModules.neovim ];
72+
specs.general = with pkgs.vimPlugins; [
73+
# plugins which are loaded at startup ...
74+
];
75+
specs.lazy = {
76+
lazy = true;
77+
data = with pkgs.vimPlugins; [
78+
# plugins which are not loaded until you vim.cmd.packadd them ...
79+
];
80+
};
81+
extraPackages = with pkgs; [
82+
# lsps, formatters, etc...
83+
];
84+
settings.config_directory = ./.; # or lib.generators.mkLuaInline "vim.fn.stdpath('config')";
85+
}
86+
```
87+
88+
At the same time, you may find that the `module.nix` file from this template is not massively more complex than that either,
89+
and contains some useful tricks and information.

0 commit comments

Comments
 (0)