Compare commits

..

7 commits

12 changed files with 83 additions and 135 deletions

View file

@ -1,13 +1,12 @@
# Configuring {#sec-configuring-plugins} # Configuring {#sec-configuring-plugins}
Just making the plugin to your Neovim configuration available might not always Just making the plugin to your Neovim configuration available might not always be enough. In that
be enough. In that case, you can write custom lua config using either case, you can write custom lua config using either `config.vim.lazy.plugins.*.setupOpts`
`config.vim.lazy.plugins.*.setupOpts` `config.vim.extraPlugins.*.setup` or `config.vim.extraPlugins.*.setup` or `config.vim.luaConfigRC`.
`config.vim.luaConfigRC`.
The first option uses an extended version of `lz.n`'s PluginSpec. `setupModule` The first option uses an extended version of `lz.n`'s PluginSpec. `setupModule` and `setupOpt` can
and `setupOpt` can be used if the plugin uses a `require('module').setup(...)` be used if the plugin uses a `require('module').setup(...)` pattern. Otherwise, the `before` and
pattern. Otherwise, the `before` and `after` hooks should do what you need. `after` hooks should do what you need.
```nix ```nix
{ {
@ -25,11 +24,10 @@ pattern. Otherwise, the `before` and `after` hooks should do what you need.
} }
``` ```
The second option uses an attribute set, which maps DAG section names to a The second option uses an attribute set, which maps DAG section names to a custom type, which has
custom type, which has the fields `package`, `after`, `setup`. They allow you to the fields `package`, `after`, `setup`. They allow you to set the package of the plugin, the
set the package of the plugin, the sections its setup code should be after (note sections its setup code should be after (note that the `extraPlugins` option has its own DAG
that the `extraPlugins` option has its own DAG scope), and the its setup code scope), and the its setup code respectively. For example:
respectively. For example:
```nix ```nix
config.vim.extraPlugins = with pkgs.vimPlugins; { config.vim.extraPlugins = with pkgs.vimPlugins; {
@ -58,17 +56,13 @@ For example:
} }
``` ```
<!-- deno-fmt-ignore-start -->
:::{.note} :::{.note}
One of the greatest strengths of nvf is the ability to order If your configuration needs to be put in a specific place in the config, you
snippets of configuration via the DAG system. It will allow specifying positions can use functions from `inputs.nvf.lib.nvim.dag` to order it. Refer to
of individual sections of configuration as needed. nvf provides helper functions https://github.com/nix-community/home-manager/blob/master/modules/lib/dag.nix
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.
::: :::
<!-- deno-fmt-ignore-end --> If you successfully made your plugin work, please feel free to create a PR to
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 v0.5, the method of adding new plugins was adding the plugin Prior to version 0.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,14 +8,13 @@ the plugins is determined by DAGs.
## Adding plugins {#sec-adding-plugins} ## Adding plugins {#sec-adding-plugins}
To add a plugin not available in nvf as a module to your configuration, you may To add a plugin to **nvf**'s runtime, you may add it
add it to [](#opt-vim.startPlugins) in order to make it available to Neovim at
runtime.
```nix ```nix
{pkgs, ...}: { {pkgs, ...}: {
# Add a Neovim plugin from Nixpkgs to the runtime. # add a package from nixpkgs to startPlugins
vim.startPlugins = [pkgs.vimPlugins.aerial-nvim]; vim.startPlugins = [
pkgs.vimPlugins.aerial-nvim ];
} }
``` ```
@ -24,9 +23,7 @@ provide configuration as a DAG using the **nvf** extended library.
```nix ```nix
{inputs, ...}: let {inputs, ...}: let
# This assumes you have an input called 'nvf' in your flake inputs # assuming you have an input called nvf pointing at the nvf repository
# 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,25 +1,16 @@
# Hacking nvf {#ch-hacking} # Hacking nvf {#ch-hacking}
[open issues]: https://github.com/notashelf/nvf/issues **nvf** is designed for developers as much as it is for the end user. I would like any potential contributor
[new issue]: https://github.com/notashelf/nvf/issues/new to be able to propagate their desired changes into the repository without the extra effort. As such, below are guides
(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.
nvf is designed for the developer as much as it is designed for the end-user. We This section is mainly directed towards those who wish to contribute code into **nvf**. If you wish to instead
would like for any contributor to be able to propagate their changes, or add new report a bug or discuss a potential feature implementation, first look among the
features to the project with minimum possible friction. As such, below are the already [open issues](https://github.com/notashelf/nvf/issues) and if no matching issue exists you may open
guides and guidelines written to streamline the contribution process and to a [new issue](https://github.com/notashelf/nvf/issues/new) and describe your problem/request. While creating an
ensure that your valuable input integrates into nvf's development as seamlessly issue, please try to include as much information as you can, ideally also include relevant context in which an issue
as possible without leaving any question marks in your head. occurs or a feature should be implemented.
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,12 +1,9 @@
# 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 the standalone installation method, which does not depend on a module system and may
may be done on any system that has the Nix package manager or the appropriate be done on any system that has the Nix package manager or the appropriate modules
modules for NixOS and home-manager as described in the for NixOS and home-manager as described in the [module installation section](#ch-module-installation)
[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=//quirks.html ```{=include=} appendix html:into-file=//plugins.html
quirks.md plugins.md
``` ```
```{=include=} appendix html:into-file=//options.html ```{=include=} appendix html:into-file=//options.html

View file

@ -1,14 +1,8 @@
# Neovim Flake Configuration Options {#ch-options} # Neovim Flake Configuration Options {#ch-options}
Below are the module options provided by nvf, in no particular order. Most Below are the options provided by nvf provided in no particular order.
options will include useful comments, warnings or setup tips on how a module They may include useful comments and warnings, or examples on how a module option
option is meant to be used as well as examples in complex cases. is meant to be used.
<!--
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-

16
docs/manual/plugins.md Normal file
View file

@ -0,0 +1,16 @@
# 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,22 +1,16 @@
# NodeJS {#ch-quirks-nodejs} # NodeJS {#ch-plugins-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 When working with NodeJS, everything works as expected, but some projects have settings that can fool nvf.
settings that can fool nvf.
If [this plugin](https://github.com/prettier/eslint-plugin-prettier) or similar 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`).
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 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))
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 In the end, you get discrepancies between what your editor does and what it wants.
wants.
Solutions are: Solutions are:

View file

@ -1,20 +1,7 @@
# Preface {#ch-preface} # Preface {#ch-preface}
## What is nvf {#sec-what-is-it} If you noticed a bug caused by **nvf** then please consider reporting it over
[the issue tracker](https://github.com/notashelf/nvf/issues).
nvf is a highly modular, configurable, extensible and easy to use Neovim Bugfixes, feature additions and upstreamed changes from your local configurations
configuration in Nix. Designed for flexibility and ease of use, nvf allows you are always welcome in the [the pull requests tab](https://github.com/notashelf/nvf/pulls).
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].

View file

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