mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
neovimUtils.wrapNeovimUnstable: support vim.o.exrc (#395991)
This commit is contained in:
commit
4a065b44a0
3 changed files with 8 additions and 5 deletions
|
@ -59,7 +59,7 @@ For instance, `sqlite-lua` needs `g:sqlite_clib_path` to be set to work. Nixpkgs
|
||||||
- `neovimRcContent`: Extra vimL code sourced by the generated `init.lua`.
|
- `neovimRcContent`: Extra vimL code sourced by the generated `init.lua`.
|
||||||
- `wrapperArgs`: Extra arguments forwarded to the `makeWrapper` call.
|
- `wrapperArgs`: Extra arguments forwarded to the `makeWrapper` call.
|
||||||
- `wrapRc`: Nix, not being able to write in your `$HOME`, loads the
|
- `wrapRc`: Nix, not being able to write in your `$HOME`, loads the
|
||||||
generated Neovim configuration via its `-u` argument, i.e. : `-u /nix/store/...generatedInit.lua`. This has side effects like preventing Neovim from reading your config in `$XDG_CONFIG_HOME` (see bullet 7 of [`:help startup`](https://neovim.io/doc/user/starting.html#_initialization) in Neovim). Disable it if you want to generate your own wrapper. You can still reuse while reusing the logic of the nixpkgs wrapper and access the generated config via `neovim.passthru.initRc`.
|
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.
|
- `plugins`: A list of plugins to add to the wrapper.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -37,4 +37,6 @@
|
||||||
|
|
||||||
### Additions and Improvements {#sec-nixpkgs-release-25.11-lib-additions-improvements}
|
### Additions and Improvements {#sec-nixpkgs-release-25.11-lib-additions-improvements}
|
||||||
|
|
||||||
- Create the first release note entry in this section!
|
- `neovim`: Added support for the `vim.o.exrc` option, the `VIMINIT` environment variable, and sourcing of `sysinit.vim`.
|
||||||
|
|
||||||
|
See the neovim help page [`:help startup`](https://neovim.io/doc/user/starting.html#startup) for more information, as well as [the nixpkgs neovim wrapper documentation](#neovim-custom-configuration).
|
||||||
|
|
|
@ -48,7 +48,7 @@ let
|
||||||
viAlias ? false,
|
viAlias ? false,
|
||||||
|
|
||||||
# additional argument not generated by makeNeovimConfig
|
# additional argument not generated by makeNeovimConfig
|
||||||
# it will append "-u <customRc>" to the wrapped arguments
|
# it sets the VIMINIT environment variable to "lua dofile('${customRc}')"
|
||||||
# set to false if you want to control where to save the generated config
|
# set to false if you want to control where to save the generated config
|
||||||
# (e.g., in ~/.config/init.vim or project/.nvimrc)
|
# (e.g., in ~/.config/init.vim or project/.nvimrc)
|
||||||
wrapRc ? true,
|
wrapRc ? true,
|
||||||
|
@ -193,8 +193,9 @@ let
|
||||||
"${placeholder "out"}/rplugin.vim"
|
"${placeholder "out"}/rplugin.vim"
|
||||||
]
|
]
|
||||||
++ lib.optionals finalAttrs.wrapRc [
|
++ lib.optionals finalAttrs.wrapRc [
|
||||||
"--add-flags"
|
"--set-default"
|
||||||
"-u ${writeText "init.lua" rcContent}"
|
"VIMINIT"
|
||||||
|
"lua dofile('${writeText "init.lua" rcContent}')"
|
||||||
]
|
]
|
||||||
++ finalAttrs.generatedWrapperArgs;
|
++ finalAttrs.generatedWrapperArgs;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue