Compare commits

..

16 commits

Author SHA1 Message Date
raf
4f7c96c20f
Merge 5987b911e8 into 383924d225 2024-11-07 12:18:00 +00:00
5987b911e8
docs/hacking: make preface more readable & friendly 2024-11-07 15:17:51 +03:00
2016ca1473
docs/installation: un-linline section link 2024-11-07 15:17:24 +03:00
a831d229d4
docs/options: include warning about option prefix 2024-11-07 15:16:53 +03:00
49f751ee18
docs: use the correct path for quirks.md 2024-11-07 15:08:53 +03:00
3e571d0e0c
docs/preface: include project description in the preface 2024-11-07 15:07:22 +03:00
5c09def08e
docs/plugins: rename to 'quirks' to be more general 2024-11-07 15:07:02 +03:00
318e972a77
docs/try-it-out: correct number of available configs; fix typos 2024-11-07 15:06:07 +03:00
383924d225
meta: update release info 2024-11-07 11:12:38 +03:00
4435754702
docs/custom-plugins: improve wording for DAG; link to local docs 2024-11-07 10:58:40 +03:00
a2b9e645eb
docs/custom-plugins: better wording and edge cases in legacy-method.md 2024-11-07 10:57:59 +03:00
3e0e9331f0
docs: add preface to modules chapter 2024-11-07 10:37:59 +03:00
c1904bc9e5
docs/installation: add standalone flake example 2024-11-07 10:37:58 +03:00
94f6f7eceb
docs: fix typo in standalone installation pages 2024-11-07 10:37:57 +03:00
2a2d1b6d2c
docs: clean up project README 2024-11-07 10:37:56 +03:00
07f6ac5db0
flake: improve deprecation messages for old neovim-flake modules' 2024-11-07 10:37:43 +03:00
12 changed files with 135 additions and 83 deletions

View file

@ -1,12 +1,13 @@
# Configuring {#sec-configuring-plugins} # Configuring {#sec-configuring-plugins}
Just making the plugin to your Neovim configuration available might not always be enough. In that Just making the plugin to your Neovim configuration available might not always
case, you can write custom lua config using either `config.vim.lazy.plugins.*.setupOpts` be enough. In that case, you can write custom lua config using either
`config.vim.extraPlugins.*.setup` or `config.vim.luaConfigRC`. `config.vim.lazy.plugins.*.setupOpts` `config.vim.extraPlugins.*.setup` or
`config.vim.luaConfigRC`.
The first option uses an extended version of `lz.n`'s PluginSpec. `setupModule` and `setupOpt` can The first option uses an extended version of `lz.n`'s PluginSpec. `setupModule`
be used if the plugin uses a `require('module').setup(...)` pattern. Otherwise, the `before` and and `setupOpt` can be used if the plugin uses a `require('module').setup(...)`
`after` hooks should do what you need. pattern. Otherwise, the `before` and `after` hooks should do what you need.
```nix ```nix
{ {
@ -24,10 +25,11 @@ be used if the plugin uses a `require('module').setup(...)` pattern. Otherwise,
} }
``` ```
The second option uses an attribute set, which maps DAG section names to a custom type, which has The second option uses an attribute set, which maps DAG section names to a
the fields `package`, `after`, `setup`. They allow you to set the package of the plugin, the custom type, which has the fields `package`, `after`, `setup`. They allow you to
sections its setup code should be after (note that the `extraPlugins` option has its own DAG set the package of the plugin, the sections its setup code should be after (note
scope), and the its setup code respectively. For example: that the `extraPlugins` option has its own DAG scope), and the its setup code
respectively. For example:
```nix ```nix
config.vim.extraPlugins = with pkgs.vimPlugins; { config.vim.extraPlugins = with pkgs.vimPlugins; {
@ -56,13 +58,17 @@ For example:
} }
``` ```
<!-- deno-fmt-ignore-start -->
::: {.note} ::: {.note}
If your configuration needs to be put in a specific place in the config, you One of the greatest strengths of nvf is the ability to order
can use functions from `inputs.nvf.lib.nvim.dag` to order it. Refer to snippets of configuration via the DAG system. It will allow specifying positions
https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix of individual sections of configuration as needed. nvf provides helper functions
in the extended library, usually under `inputs.nvf.lib.nvim.dag` that you may
use.
Please refer to the [DAG section](/index.xhtml#ch-dag-entries) in the nvf manual
to find out more about the DAG system. to find out more about the DAG system.
::: :::
If you successfully made your plugin work, please feel free to create a PR to <!-- deno-fmt-ignore-end -->
add it to **nvf** or open an issue with your findings so that we can make it
available for everyone easily.

View file

@ -1,6 +1,6 @@
# Legacy Method {#sec-legacy-method} # Legacy Method {#sec-legacy-method}
Prior to version 0.5, the method of adding new plugins was adding the plugin Prior to version v0.5, the method of adding new plugins was adding the plugin
package to `vim.startPlugins` and add its configuration as a DAG under one of package to `vim.startPlugins` and add its configuration as a DAG under one of
`vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or `vim.configRC` or `vim.luaConfigRC`. Users who have not yet updated to 0.5, or
prefer a more hands-on approach may use the old method where the load order of prefer a more hands-on approach may use the old method where the load order of
@ -8,13 +8,14 @@ the plugins is determined by DAGs.
## Adding plugins {#sec-adding-plugins} ## Adding plugins {#sec-adding-plugins}
To add a plugin to **nvf**'s runtime, you may add it To add a plugin not available in nvf as a module to your configuration, you may
add it to [](#opt-vim.startPlugins) in order to make it available to Neovim at
runtime.
```nix ```nix
{pkgs, ...}: { {pkgs, ...}: {
# add a package from nixpkgs to startPlugins # Add a Neovim plugin from Nixpkgs to the runtime.
vim.startPlugins = [ vim.startPlugins = [pkgs.vimPlugins.aerial-nvim];
pkgs.vimPlugins.aerial-nvim ];
} }
``` ```
@ -23,7 +24,9 @@ provide configuration as a DAG using the **nvf** extended library.
```nix ```nix
{inputs, ...}: let {inputs, ...}: let
# assuming you have an input called nvf pointing at the nvf repository # This assumes you have an input called 'nvf' in your flake inputs
# and 'inputs' in your specialArgs. In the case you have passed 'nvf'
# to specialArgs, the 'inputs' prefix may be omitted.
inherit (inputs.nvf.lib.nvim.dag) entryAnywhere; inherit (inputs.nvf.lib.nvim.dag) entryAnywhere;
in { in {
vim.luaConfigRC.aerial-nvim= entryAnywhere '' vim.luaConfigRC.aerial-nvim= entryAnywhere ''

View file

@ -1,16 +1,25 @@
# Hacking nvf {#ch-hacking} # Hacking nvf {#ch-hacking}
**nvf** is designed for developers as much as it is for the end user. I would like any potential contributor [open issues]: https://github.com/notashelf/nvf/issues
to be able to propagate their desired changes into the repository without the extra effort. As such, below are guides [new issue]: https://github.com/notashelf/nvf/issues/new
(and guidelines) to streamline the contribution process and ensure that your valuable input seamlessly integrates
into **nvf**'s development without leaving question marks in your head.
This section is mainly directed towards those who wish to contribute code into **nvf**. If you wish to instead nvf is designed for the developer as much as it is designed for the end-user. We
report a bug or discuss a potential feature implementation, first look among the would like for any contributor to be able to propagate their changes, or add new
already [open issues](https://github.com/notashelf/nvf/issues) and if no matching issue exists you may open features to the project with minimum possible friction. As such, below are the
a [new issue](https://github.com/notashelf/nvf/issues/new) and describe your problem/request. While creating an guides and guidelines written to streamline the contribution process and to
issue, please try to include as much information as you can, ideally also include relevant context in which an issue ensure that your valuable input integrates into nvf's development as seamlessly
occurs or a feature should be implemented. as possible without leaving any question marks in your head.
This section is directed mainly towards those who wish to contribute code into
the project. If you instead wish to report a bug, or discuss a potential new
feature implementation (which you do not wish to implement yourself) first look
among the already [open issues] and if no matching issue exists you may open a
[new issue] and describe your problem/request.
While creating an issue, please try to include as much information as you can,
ideally also include relevant context in which an issue occurs or a feature
should be implemented. If you wish to make a contribution, but feel stuck -
please do not be afraid to submit a pull request, we will help you get it in.
```{=include=} sections ```{=include=} sections
hacking/getting-started.md hacking/getting-started.md

View file

@ -1,9 +1,12 @@
# Installing nvf {#ch-installation} # Installing nvf {#ch-installation}
[module installation section]: #ch-module-installation
There are multiple ways of installing nvf on your system. You may either choose There are multiple ways of installing nvf on your system. You may either choose
the standalone installation method, which does not depend on a module system and may the standalone installation method, which does not depend on a module system and
be done on any system that has the Nix package manager or the appropriate modules may be done on any system that has the Nix package manager or the appropriate
for NixOS and home-manager as described in the [module installation section](#ch-module-installation) modules for NixOS and home-manager as described in the
[module installation section].
```{=include=} chapters ```{=include=} chapters
installation/custom-configuration.md installation/custom-configuration.md

View file

@ -17,8 +17,8 @@ configuring.md
hacking.md hacking.md
``` ```
```{=include=} appendix html:into-file=//plugins.html ```{=include=} appendix html:into-file=//quirks.html
plugins.md quirks.md
``` ```
```{=include=} appendix html:into-file=//options.html ```{=include=} appendix html:into-file=//options.html

View file

@ -1,8 +1,14 @@
# Neovim Flake Configuration Options {#ch-options} # Neovim Flake Configuration Options {#ch-options}
Below are the options provided by nvf provided in no particular order. Below are the module options provided by nvf, in no particular order. Most
They may include useful comments and warnings, or examples on how a module option options will include useful comments, warnings or setup tips on how a module
is meant to be used. option is meant to be used as well as examples in complex cases.
<!--
In the manual, individual options may be referenced in Hyperlinks as follows:
[](#opt-vim.*) If changing the prefix here, do keep in mind the #opt- suffix will have
to be changed everywhere.
-->
```{=include=} options ```{=include=} options
id-prefix: opt- id-prefix: opt-

View file

@ -1,16 +0,0 @@
# Plugin specific quirks {#ch-plugins}
At times, certain plugins refuse to play nicely. Be it as a result of generating
lua from Nix, or the state of packaging. This page shall list any plugins that
are known to misbehave, and potential workarounds.
```{=include=} chapters
plugins/nodejs.md
```
<!--
If adding a new section, uncomment this part and add your page to
plugins/<page>.md
```{=include=} chapters
plugins/page.md
```
-->

View file

@ -1,7 +1,20 @@
# Preface {#ch-preface} # Preface {#ch-preface}
If you noticed a bug caused by **nvf** then please consider reporting it over ## What is nvf {#sec-what-is-it}
[the issue tracker](https://github.com/notashelf/nvf/issues).
Bugfixes, feature additions and upstreamed changes from your local configurations nvf is a highly modular, configurable, extensible and easy to use Neovim
are always welcome in the [the pull requests tab](https://github.com/notashelf/nvf/pulls). configuration in Nix. Designed for flexibility and ease of use, nvf allows you
to easily configure your fully featured Neovim instance with a few lines of Nix.
## Bugs & Suggestions {#sec-bugs-suggestions}
[issue tracker]: https://github.com/notashelf/nvf/issues
[discussions tab]: https://github.com/notashelf/nvf/discussions
[pull requests tab]: https://github.com/notashelf/nvf/pulls
If you notice any issues with nvf, or this documentation, then please consider
reporting them over at the [issue tracker]. Issues tab, in addition to the
[discussions tab] is a good place as any to request new features.
You may also consider submitting bugfixes, feature additions and upstreamed
changes that you think are critical over at the [pull requests tab].

13
docs/manual/quirks.md Normal file
View file

@ -0,0 +1,13 @@
# Known Issues and Quirks {#ch-known-issues-quirks}
At times, certain plugins and modules may refuse to play nicely with your setup,
be it a result of generating Lua from Nix, or the state of packaging. This page,
in turn, will list any known modules or plugins that are known to misbehave, and
possible workarounds that you may apply.
<!-- If adding a new known quirk, please create a new page in quirks/ and include
the name of the file here.-->
```{=include=} chapters
quirks/nodejs.md
```

View file

@ -1,16 +1,22 @@
# NodeJS {#ch-plugins-nodejs} # NodeJS {#ch-quirks-nodejs}
## eslint-plugin-prettier {#sec-eslint-plugin-prettier} ## eslint-plugin-prettier {#sec-eslint-plugin-prettier}
When working with NodeJS, everything works as expected, but some projects have settings that can fool nvf. When working with NodeJS, everything works as expected, but some projects have
settings that can fool nvf.
If [this plugin](https://github.com/prettier/eslint-plugin-prettier) or similar is included, you might get a situation where your eslint configuration diagnoses your formatting according to its own config (usually `.eslintrc.js`). If [this plugin](https://github.com/prettier/eslint-plugin-prettier) or similar
is included, you might get a situation where your eslint configuration diagnoses
your formatting according to its own config (usually `.eslintrc.js`).
The issue there is your formatting is made via prettierd. The issue there is your formatting is made via prettierd.
This results in auto-formating relying on your prettier config, while your eslint config diagnoses formatting [which it's not supposed to](https://prettier.io/docs/en/comparison.html)) This results in auto-formating relying on your prettier config, while your
eslint config diagnoses formatting
[which it's not supposed to](https://prettier.io/docs/en/comparison.html))
In the end, you get discrepancies between what your editor does and what it wants. In the end, you get discrepancies between what your editor does and what it
wants.
Solutions are: Solutions are:

View file

@ -1,25 +1,27 @@
# Try it out {#ch-try-it-out} # Try it out {#ch-try-it-out}
Thanks to the portability of Nix, you can try out nvf without actually installing it to your machine. Thanks to the portability of Nix, you can try out nvf without actually
Below are the commands you may run to try out different configurations provided by this flake. As of v0.5, three installing it to your machine. Below are the commands you may run to try out
different configurations provided by this flake. As of v0.5, two specialized
configurations are provided: configurations are provided:
- Nix - **Nix** - Nix language server + simple utility plugins
- Maximal - **Maximal** - Variable language servers + utility and decorative plugins
You may try out any of the provided configurations using the `nix run` command on a system where Nix is installed. You may try out any of the provided configurations using the `nix run` command
on a system where Nix is installed.
```console ```bash
$ cachix use nvf # Optional: it'll save you CPU resources and time $ cachix use nvf # Optional: it'll save you CPU resources and time
$ nix run github:notashelf/nvf#nix # will run the default minimal configuration $ nix run github:notashelf/nvf#nix # will run the default minimal configuration
``` ```
Do keep in mind that this is **susceptible to garbage collection** meaning it will be removed from your Nix store Do keep in mind that this is **susceptible to garbage collection** meaning it
once you garbage collect. will be removed from your Nix store once you garbage collect.
## Using Prebuilt Configs {#sec-using-prebuild-configs} ## Using Prebuilt Configs {#sec-using-prebuilt-configs}
```console ```bash
$ nix run github:notashelf/nvf#nix $ nix run github:notashelf/nvf#nix
$ nix run github:notashelf/nvf#maximal $ nix run github:notashelf/nvf#maximal
``` ```
@ -28,12 +30,19 @@ $ nix run github:notashelf/nvf#maximal
#### Nix {#sec-configs-nix} #### Nix {#sec-configs-nix}
`Nix` configuration by default provides LSP/diagnostic support for Nix alongisde a set of visual and functional plugins. `Nix` configuration by default provides LSP/diagnostic support for Nix alongside
By running `nix run .#`, which is the default package, you will build Neovim with this config. a set of visual and functional plugins. By running `nix run .#`, which is the
default package, you will build Neovim with this config.
#### Maximal {#sec-configs-maximal} #### Maximal {#sec-configs-maximal}
`Maximal` is the ultimate configuration that will enable support for more commonly used language as well as additional `Maximal` is the ultimate configuration that will enable support for more
complementary plugins. Keep in mind, however, that this will pull a lot of dependencies. commonly used language as well as additional complementary plugins. Keep in
mind, however, that this will pull a lot of dependencies.
You are _strongly_ recommended to use the binary cache if you would like to try the Maximal configuration. ::: {.tip}
You are _strongly_ recommended to use the binary cache if you would like to try
the Maximal configuration.
:::

View file

@ -1,4 +1,4 @@
{ {
"release": "v0.6", "release": "v0.7",
"isReleaseBranch": true "isReleaseBranch": false
} }