mirror of
https://github.com/nix-community/nixvim.git
synced 2025-12-08 10:01:07 +01:00
treewide: NixVim/nixvim -> Nixvim
Signed-off-by: saygo-png <saygo.mail@proton.me>
This commit is contained in:
parent
5d1c27e53c
commit
03a51dbf3d
34 changed files with 78 additions and 78 deletions
|
|
@ -8,7 +8,7 @@ Take a look at these configuration examples below.
|
|||
|
||||
**Note:**\
|
||||
Most of those configurations are using a [standalone build](../platforms/standalone.html), however,
|
||||
all of the nixvim options are accessible no matter how you are using it (flake, NixOS/HM module, nix-darwin...).
|
||||
all of the Nixvim options are accessible no matter how you are using it (flake, NixOS/HM module, nix-darwin...).
|
||||
|
||||
@USER_CONFIGS@
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Using a plugin not supported by nixvim, but packaged in nixpkgs is straightforwa
|
|||
- Register the plugin through `extraPlugins`: `extraPlugins = [pkgs.vimPlugins."<plugin name>"]`.
|
||||
- Configure the plugin through `extraConfigLua`: `extraConfigLua = "require('my-plugin').setup({foo = "bar"})";`
|
||||
|
||||
## How do I use a plugin not yet merged into NixVim or temporarily modify one
|
||||
## How do I use a plugin not yet merged into Nixvim or temporarily modify one
|
||||
|
||||
Copy the module expression formatted like this into a file:
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
}
|
||||
```
|
||||
|
||||
Import it into your NixVim configuration and configure it:
|
||||
Import it into your Nixvim configuration and configure it:
|
||||
```nix
|
||||
{
|
||||
# Remove this `programs.nixvim` wrapper for standalone configurations
|
||||
|
|
@ -84,13 +84,13 @@ When using Nixvim, it is possible to encounter errors about something not being
|
|||
```
|
||||
|
||||
This usually means one of two things:
|
||||
- The nixpkgs version is not in line with NixVim (for example nixpkgs nixos-25.11 is used with NixVim master)
|
||||
- The nixpkgs unstable version used with NixVim is not recent enough.
|
||||
- The nixpkgs version is not in line with Nixvim (for example nixpkgs nixos-25.11 is used with Nixvim master)
|
||||
- The nixpkgs unstable version used with Nixvim is not recent enough.
|
||||
|
||||
When building nixvim using flakes and our ["standalone mode"][standalone], we usually recommend _not_ declaring a "follows" for `inputs.nixvim`.
|
||||
This is so that nixvim is built against the same nixpkgs revision we're using in our test suite.
|
||||
When building Nixvim using flakes and our ["standalone mode"][standalone], we usually recommend _not_ declaring a "follows" for `inputs.nixvim`.
|
||||
This is so that Nixvim is built against the same nixpkgs revision we're using in our test suite.
|
||||
|
||||
If you are building nixvim using the NixOS, Home Manager, or nix-darwin modules then we advise that you keep your nixpkgs lock as close as possible to ours.
|
||||
If you are building Nixvim using the NixOS, Home Manager, or nix-darwin modules then we advise that you keep your nixpkgs lock as close as possible to ours.
|
||||
|
||||
> [!TIP]
|
||||
> Once [#1784](https://github.com/nix-community/nixvim/issues/1784) is implemented, there will be alternative ways to achieve this using the module system.
|
||||
|
|
@ -139,7 +139,7 @@ keymaps = [
|
|||
[`map`]: https://nixos.org/manual/nix/stable/language/builtins#builtins-map
|
||||
[`keymaps`]: ../keymaps
|
||||
|
||||
## How to use system provided binaries instead of nixvim provided ones
|
||||
## How to use system provided binaries instead of Nixvim provided ones
|
||||
|
||||
There are a number of plugins that install extra packages using `nix`, but this can cause issues.
|
||||
For example enabling `plugins.treesitter` could add `gcc` to the PATH of neovim, and this could break workflows that rely on the system provided compiler.
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
# Installation
|
||||
|
||||
You must use a `nixpkgs` version compatible with the nixvim version you choose.
|
||||
You must use a `nixpkgs` version compatible with the Nixvim version you choose.
|
||||
|
||||
The `main` branch requires to use a _very recent_ version of nixpkgs unstable.
|
||||
In order to guarantee the compatibility between nixvim & nixpkgs it is recommended to always update both at the same time.
|
||||
In order to guarantee the compatibility between Nixvim & nixpkgs it is recommended to always update both at the same time.
|
||||
|
||||
When using a `stable` version you must use the corresponding nixvim branch, for example `nixos-25.11` when using NixOS 25.11.
|
||||
When using a `stable` version you must use the corresponding Nixvim branch, for example `nixos-25.11` when using NixOS 25.11.
|
||||
|
||||
Failure to use the correct branch, or an old revision of nixpkgs will likely result in errors of the form `vimPlugins.<name> attribute not found`.
|
||||
|
||||
NixVim can be used in four ways:
|
||||
Nixvim can be used in four ways:
|
||||
- As a NixOS module
|
||||
- As a Home Manager module
|
||||
- As a nix-darwin module
|
||||
- As a standalone derivation
|
||||
|
||||
NixVim is also available for nix flakes, or directly through an import.
|
||||
Nixvim is also available for nix flakes, or directly through an import.
|
||||
|
||||
## Accessing nixvim
|
||||
|
||||
For a direct import you can add nixvim to your configuration as follows:
|
||||
For a direct import you can add Nixvim to your configuration as follows:
|
||||
```nix
|
||||
let
|
||||
nixvim = import (builtins.fetchGit {
|
||||
|
|
@ -45,30 +45,30 @@ When using flakes you can simply add `nixvim` to the inputs:
|
|||
|
||||
## Usage
|
||||
|
||||
NixVim can be used standalone or as a module for NixOS, Home Manager, or nix-darwin.
|
||||
Nixvim can be used standalone or as a module for NixOS, Home Manager, or nix-darwin.
|
||||
|
||||
When used standalone, a custom NixVim derivation is produced that can be used like any other package.
|
||||
When used standalone, a custom Nixvim derivation is produced that can be used like any other package.
|
||||
|
||||
When used as a module, NixVim can be enabled though `programs.nixvim.enable`.
|
||||
When used as a module, Nixvim can be enabled though `programs.nixvim.enable`.
|
||||
|
||||
|
||||
### Usage as a module (NixOS, Home Manager, nix-darwin)
|
||||
|
||||
When using NixVim as a module you must import the NixVim module into your module system.
|
||||
When using Nixvim as a module you must import the Nixvim module into your module system.
|
||||
The three imports are:
|
||||
- `<nixvim>.homeModules.nixvim`
|
||||
- `<nixvim>.nixosModules.nixvim`
|
||||
- `<nixvim>.nixDarwinModules.nixvim`
|
||||
|
||||
`<nixvim>` refers to the way to access nixvim, depending on how you fetched nixvim as described in the previous section.
|
||||
`<nixvim>` refers to the way to access Nixvim, depending on how you fetched Nixvim as described in the previous section.
|
||||
|
||||
The imports can be added as a `imports = [ <nixvim_import> ]` in a configuration file.
|
||||
|
||||
You will then be able to enable nixvim through `programs.nixvim.enable = true`, and configure the
|
||||
You will then be able to enable Nixvim through `programs.nixvim.enable = true`, and configure the
|
||||
options as `programs.nixvim.<path>.<to>.<option> = <value>`.
|
||||
|
||||
> [!TIP]
|
||||
> Use `programs.nixvim.imports` to include modules configuring NixVim so you get NixVim's extended `lib` in the `lib` module argument and you don't have to prefix everything with `programs.nixvim`.
|
||||
> Use `programs.nixvim.imports` to include modules configuring Nixvim so you get Nixvim's extended `lib` in the `lib` module argument and you don't have to prefix everything with `programs.nixvim`.
|
||||
>
|
||||
> <!-- This is also in /docs/lib/index.md -->
|
||||
>
|
||||
|
|
@ -87,29 +87,29 @@ options as `programs.nixvim.<path>.<to>.<option> = <value>`.
|
|||
> # You can use lib.nixvim in your config
|
||||
> fooOption = lib.nixvim.mkRaw "print('hello')";
|
||||
>
|
||||
> # Configure NixVim without prefixing with `plugins.nixvim`
|
||||
> # Configure Nixvim without prefixing with `plugins.nixvim`
|
||||
> plugins.my-plugin.enable = true;
|
||||
> }
|
||||
> ```
|
||||
|
||||
When you use nixvim as a module, an additional module argument is passed on allowing you to peek through the configuration with `hmConfig`, `nixosConfig`, and `darwinConfig` for Home Manager, NixOS, and nix-darwin respectively.
|
||||
This is useful if you use nixvim both as part of an environment and standalone.
|
||||
When you use Nixvim as a module, an additional module argument is passed on allowing you to peek through the configuration with `hmConfig`, `nixosConfig`, and `darwinConfig` for Home Manager, NixOS, and nix-darwin respectively.
|
||||
This is useful if you use Nixvim both as part of an environment and standalone.
|
||||
|
||||
For more platform-specific options and information, see [Nixvim Platforms](../platforms/index.md).
|
||||
|
||||
### Standalone usage
|
||||
|
||||
When using nixvim as a standalone derivation you can use the following functions, located in `<nixvim>.legacyPackages.${system}`:
|
||||
When using Nixvim as a standalone derivation you can use the following functions, located in `<nixvim>.legacyPackages.${system}`:
|
||||
- `makeNixvim`: A simplified version of `makeNixvimWithModule` for when you only need to specify `module` and the other options can be left as the defaults.
|
||||
This function's only argument is a nixvim module, e.g. `{ extraConfigLua = "print('hi')"; }`
|
||||
This function's only argument is a Nixvim module, e.g. `{ extraConfigLua = "print('hi')"; }`
|
||||
- `makeNixvimWithModule`: This function takes an attribute set of the form: `{pkgs, extraSpecialArgs, module}`.
|
||||
The only required argument is `module`, being a nixvim module. This gives access to the `imports`, `options`, `config` variables, and using functions like `{config, ...}: { ... }`.
|
||||
The only required argument is `module`, being a Nixvim module. This gives access to the `imports`, `options`, `config` variables, and using functions like `{config, ...}: { ... }`.
|
||||
|
||||
There are also some helper functions in `<nixvim>.lib.${system}` like:
|
||||
- `check.mkTestDerivationFromNixvimModule`, taking the same arguments as `makeNixvimWithModule` and generates a check derivation.
|
||||
- `check.mkTestDerivationFromNvim`, taking an attribute set of the form `{name = "<derivation name>"; nvim = <nvim derivation>}`. The `nvim` is the standalone derivation provided by NixVim.
|
||||
- `check.mkTestDerivationFromNvim`, taking an attribute set of the form `{name = "<derivation name>"; nvim = <nvim derivation>}`. The `nvim` is the standalone derivation provided by Nixvim.
|
||||
|
||||
The nixvim derivation can then be used like any other package!
|
||||
The Nixvim derivation can then be used like any other package!
|
||||
|
||||
For an example, see the [nixvim standalone flake template](https://github.com/nix-community/nixvim/blob/main/templates/simple/flake.nix).
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue