|
1 | 1 | # Adding Plugins {#sec-additional-plugins}
|
2 | 2 |
|
3 |
| -To add a new Neovim plugin, first add the source url in the inputs section of |
4 |
| -`flake.nix` with the prefix `plugin-` |
| 3 | +To add a new Neovim plugin, use `npins` |
5 | 4 |
|
6 |
| -```nix |
7 |
| -{ |
8 |
| - inputs = { |
9 |
| - # ... |
10 |
| - plugin-neodev-nvim = { |
11 |
| - url = "github:folke/neodev.nvim"; |
12 |
| - flake = false; |
13 |
| - }; |
14 |
| - # ... |
15 |
| - }; |
16 |
| -} |
17 |
| -``` |
| 5 | +Use: |
| 6 | + |
| 7 | +`nix-shell -p npins` or `nix shell nixpkgs#npins` |
| 8 | + |
| 9 | +Then run: |
| 10 | + |
| 11 | +`npins --name <plugin name> github <owner> <repo> -b <branch>` |
| 12 | + |
| 13 | +Be sure to replace any non-alphanumeric characters with `-` for `--name` |
18 | 14 |
|
19 |
| -Prepending `plugin-` to the name of the input will allow nvf to automatically |
20 |
| -discover inputs that are marked as plugins, and make them available in |
21 |
| -`vim.startPlugins` or other areas that require a very specific plugin type as it |
22 |
| -is defined in `@NVF_REPO@/lib/types/plugins.nix` |
| 15 | +For example |
23 | 16 |
|
24 |
| -The addition of the `plugin-` prefix will allow **nvf** to autodiscover the |
25 |
| -input from the flake inputs automatically, allowing you to refer to it in areas |
26 |
| -that require a very specific plugin type as defined in `lib/types/plugins.nix` |
| 17 | +`npins --name lazydev-nvim github folke laztdev.nvim -b main` |
27 | 18 |
|
28 |
| -You can now reference this plugin using its string name, the plugin will be |
29 |
| -built with the name and source URL from the flake input, allowing you to refer |
30 |
| -to it as a **string**. |
| 19 | +You can now reference this plugin as a **string**. |
31 | 20 |
|
32 | 21 | ```nix
|
33 |
| -config.vim.startPlugins = ["neodev-nvim"]; |
| 22 | +config.vim.startPlugins = ["lazydev-nvim"]; |
34 | 23 | ```
|
35 | 24 |
|
36 | 25 | ## Modular setup options {#sec-modular-setup-options}
|
|
0 commit comments