From 23507e17e7f2edd691dfcc70e1d4b0b410c4e1ee Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Jun 2026 20:21:29 -0500 Subject: [PATCH 1/7] ci/owners: add NixOS/neovim for neovim doc Make the @NixOS/neovim team the codeowner for the Neovim languages/frameworks documentation section. --- ci/OWNERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/OWNERS b/ci/OWNERS index 99972715f8e4..a37d9b33ae67 100644 --- a/ci/OWNERS +++ b/ci/OWNERS @@ -361,7 +361,8 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt /pkgs/development/lua-modules @NixOS/lua # Neovim -/pkgs/applications/editors/neovim @NixOS/neovim +/pkgs/applications/editors/neovim @NixOS/neovim +/doc/languages-frameworks/neovim.section.md @NixOS/neovim # VimPlugins /pkgs/applications/editors/vim/plugins @NixOS/neovim From 66e23f410b07195caa4bb05b5cab80826b763ce6 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Jun 2026 20:28:00 -0500 Subject: [PATCH 2/7] doc/neovim: document wrapNeovimUnstable options Document extraPython3Packages, withPerl, vimAlias, viAlias, and extraName options for wrapNeovimUnstable. --- doc/languages-frameworks/neovim.section.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/languages-frameworks/neovim.section.md b/doc/languages-frameworks/neovim.section.md index e0c22d8ccba5..248281961120 100644 --- a/doc/languages-frameworks/neovim.section.md +++ b/doc/languages-frameworks/neovim.section.md @@ -64,11 +64,14 @@ For instance, `sqlite-lua` needs `g:sqlite_clib_path` to be set to work. Nixpkgs - `wrapRc`: Nix, not being able to write in your `$HOME`, loads the generated Neovim configuration via the `$VIMINIT` environment variable, i.e. : `export VIMINIT='lua dofile("/nix/store/…-init.lua")'`. This has side effects like preventing Neovim from sourcing your `init.lua` in `$XDG_CONFIG_HOME/nvim` (see bullet 7 of [`:help startup`](https://neovim.io/doc/user/starting.html#startup) in Neovim). Disable it if you want to generate your own wrapper. You can still reuse the generated vimscript init code via `neovim.passthru.initRc`. - `plugins`: A list of plugins to add to the wrapper. -- `extraLuaPackages`: A function passed on to `lua.withPackages` -- `withPython3`, `withNodeJs`, `withRuby` control when to enable neovim +- `extraLuaPackages`: A function passed on to `lua.withPackages`. +- `extraPython3Packages`: A function passed on to `python3.withPackages`. +- `withPython3`, `withNodeJs`, `withRuby`, `withPerl` control when to enable neovim providers (see `:h provider`). +- `vimAlias` and `viAlias` control whether to symlink the `vim` and `vi` binaries to `nvim` respectively. +- `extraName` is a string appended to the package name and derivation name. -``` +```nix wrapNeovimUnstable neovim-unwrapped { autoconfigure = true; autowrapRuntimeDeps = true; @@ -98,7 +101,7 @@ wrapNeovimUnstable neovim-unwrapped { } ``` -You can explore the configuration with`nix repl` to discover these options and +You can explore the configuration with `nix repl` to discover these options and override them. For instance: ```nix neovim.overrideAttrs (oldAttrs: { From 46689fa74ac215e6b307a18016566c3165ecc339 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Jun 2026 20:28:03 -0500 Subject: [PATCH 3/7] doc/neovim: correct configuration overrides example Correct configuration overrides example to use neovim.override instead of overrideAttrs. --- doc/languages-frameworks/neovim.section.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/languages-frameworks/neovim.section.md b/doc/languages-frameworks/neovim.section.md index 248281961120..cc16860b1a02 100644 --- a/doc/languages-frameworks/neovim.section.md +++ b/doc/languages-frameworks/neovim.section.md @@ -104,9 +104,9 @@ wrapNeovimUnstable neovim-unwrapped { You can explore the configuration with `nix repl` to discover these options and override them. For instance: ```nix -neovim.overrideAttrs (oldAttrs: { +neovim.override { autowrapRuntimeDeps = false; -}) +} ``` ## Specificities for some plugins {#neovim-plugin-specificities} From 9742b211f4a53a79cbcb03033d884d82dcd0f034 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Jun 2026 20:24:28 -0500 Subject: [PATCH 4/7] doc/neovim: fix VimScript comments in examples VimScript comments start with a double quote (") instead of a hash sign (#). --- doc/languages-frameworks/neovim.section.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/languages-frameworks/neovim.section.md b/doc/languages-frameworks/neovim.section.md index cc16860b1a02..57aaae9212f9 100644 --- a/doc/languages-frameworks/neovim.section.md +++ b/doc/languages-frameworks/neovim.section.md @@ -25,7 +25,7 @@ neovim.override { withRuby = false; configure = { customRC = '' - # here your custom viml configuration goes! + " here your custom viml configuration goes! ''; packages.myVimPackage = with pkgs.vimPlugins; { # See examples below on how to use custom packages. @@ -47,7 +47,7 @@ neovim-qt.override { neovim = neovim.override { configure = { customRC = '' - # your custom viml configuration + " your custom viml configuration ''; }; }; From f7b9e91062a7e3bdab65f4dbb0e7e6c81636b388 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Jun 2026 20:24:33 -0500 Subject: [PATCH 5/7] doc/neovim: document plugin lua config type option Explain the type attribute in the plugins list configuration option, showing how to specify a Lua configuration block instead of VimScript. --- doc/languages-frameworks/neovim.section.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/languages-frameworks/neovim.section.md b/doc/languages-frameworks/neovim.section.md index 57aaae9212f9..ba258267352a 100644 --- a/doc/languages-frameworks/neovim.section.md +++ b/doc/languages-frameworks/neovim.section.md @@ -83,7 +83,8 @@ wrapNeovimUnstable neovim-unwrapped { vim.opt.colorcolumn = { 100 } vim.opt.termguicolors = true ''; - # plugins accepts a list of either plugins or { plugin = ...; config = ..vimscript.. }; + # plugins accepts a list of either plugins or attribute sets containing: + # { plugin = ...; config = ...; type = "viml"|"lua"; } (type defaults to "viml") plugins = with vimPlugins; [ { plugin = vim-obsession; @@ -91,6 +92,15 @@ wrapNeovimUnstable neovim-unwrapped { map $ Obsession ''; } + { + plugin = grug-far-nvim; + type = "lua"; + config = '' + require('grug-far').setup({ + startInInsertMode = false, + }) + ''; + } (nvim-treesitter.withPlugins (p: [ p.nix p.python ])) hex-nvim ]; From 6474a24fddf9544a3210720dd8bb20a8571d1a29 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Jun 2026 20:35:30 -0500 Subject: [PATCH 6/7] neovim/tests: use override instead of overrideAttrs for wrapper options Correct nvim_with_autoconfigure and nvim_with_runtimeDeps tests. 1. Switched from overrideAttrs to override. Overriding wrapper arguments like autoconfigure via overrideAttrs was a silent no-op because the wrapper function evaluated the lexical autoconfigure parameter instead of the derivation attribute finalAttrs.autoconfigure. 2. Switched from plugins list to configure.packages format. The legacy neovim wrapper ignores the direct plugins argument and requires plugins to be configured under configure.packages. --- .../editors/neovim/tests/default.nix | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/editors/neovim/tests/default.nix b/pkgs/applications/editors/neovim/tests/default.nix index 5bc2730da87b..c17957ffbe3a 100644 --- a/pkgs/applications/editors/neovim/tests/default.nix +++ b/pkgs/applications/editors/neovim/tests/default.nix @@ -204,23 +204,23 @@ pkgs.lib.recurseIntoAttrs rec { ${nvim_with_plug}/bin/nvim -V3log.txt -i NONE -c 'color base16-tomorrow-night' +quit! -e ''; - nvim_with_autoconfigure = pkgs.neovim.overrideAttrs { - plugins = [ - vimPlugins.unicode-vim - vimPlugins.fzf-hoogle-vim - ]; + nvim_with_autoconfigure = pkgs.neovim.override { + configure = { + packages.myPlugins.start = [ + vimPlugins.unicode-vim + vimPlugins.fzf-hoogle-vim + ]; + }; autoconfigure = true; - # legacy wrapper sets it to false - wrapRc = true; }; - nvim_with_runtimeDeps = pkgs.neovim.overrideAttrs { - plugins = [ - pkgs.vimPlugins.hex-nvim - ]; + nvim_with_runtimeDeps = pkgs.neovim.override { + configure = { + packages.myPlugins.start = [ + pkgs.vimPlugins.hex-nvim + ]; + }; autowrapRuntimeDeps = true; - # legacy wrapper sets it to false - wrapRc = true; }; nvim_with_ftplugin = From a47702c9dfe87c27e5db1342fcea846a635dcd20 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Jun 2026 20:39:59 -0500 Subject: [PATCH 7/7] doc/neovim: fix formatting Ran nixfmt and saw untouched section that needed formatting. --- doc/languages-frameworks/neovim.section.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/languages-frameworks/neovim.section.md b/doc/languages-frameworks/neovim.section.md index ba258267352a..78e9bf714013 100644 --- a/doc/languages-frameworks/neovim.section.md +++ b/doc/languages-frameworks/neovim.section.md @@ -101,7 +101,10 @@ wrapNeovimUnstable neovim-unwrapped { }) ''; } - (nvim-treesitter.withPlugins (p: [ p.nix p.python ])) + (nvim-treesitter.withPlugins (p: [ + p.nix + p.python + ])) hex-nvim ]; extraLuaPackages = lp: [ lp.mpack ];