neovim: give the choice to wrap startup commands (to set packpath, rtp, providers etc) or add them to initrc#205932
Closed
teto wants to merge 1 commit intoNixOS:masterfrom
Closed
neovim: give the choice to wrap startup commands (to set packpath, rtp, providers etc) or add them to initrc#205932teto wants to merge 1 commit intoNixOS:masterfrom
teto wants to merge 1 commit intoNixOS:masterfrom
Conversation
figsoda
reviewed
Dec 13, 2022
Member
figsoda
left a comment
There was a problem hiding this comment.
this probably needs to be updated as well:
https://github.com/NixOS/nixpkgs/blob/7fb63b2b2704864480e814772ec6e14cbc0ef7bc/pkgs/applications/editors/neovim/utils.nix#L188
We used to set rtp and packpath in the generated init.vim.
That was removed in case users wanted to keep their own init.vim rather
than one generated by nvim.
To be able to install plugins while keeping
your own init.vim, we wrap the HM binary with "startup commands" such as
--cmd' 'set rtp^=/nix/store/c1cqzhhxgxd36jj9fqv0x0xfbh5fp9gr-vim-pack-dir,/nix/store/jim60lbwdl7gln40q28zf7gqya95bdf1-grammars'
This triggers another issue when using project-specific neovim, it
isn't wrapped with these flags and thus can't properly load the
generated init.vim (plugins are missing since packdir is not set).
This PR makes it possible to revert to the old behavior with the
`wrapStartupCommands` boolean in neovim's wrapper.
This allows home-manager to generate an init.lua that can be picked up
by any neovim, not necessarily the one generated by home-manager.
7fb63b2 to
5fc7e68
Compare
Member
Author
|
Indeed. the legacyWrapper does need to use a string and it would be a pain for everyone to deprecate that until we get a proper new wrapper. So the PR doesnt deprecate the usage anymore. |
figsoda
reviewed
Dec 16, 2022
| , wrapRc ? true | ||
| # if yes, pass startupCommands as `--cmd` arguments to neovim | ||
| # if false, inline the commands in the generated initrc | ||
| , wrapStartupCommands ? true |
Member
There was a problem hiding this comment.
does that mean startupCommands would be in lua if true and in vim if false?
12 tasks
Member
Author
|
I've merged a better PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1/ We used to set rtp and packpath in the generated init.vim.
That was removed in case users wanted to keep their own init.vim rather
than one generated by nvim.
To be able to install plugins while keeping
your own init.vim, we wrap the HM binary with "startup commands" such as
This triggers another issue when using project-specific neovim, it
isn't wrapped with these flags and thus can't properly load the
generated init.vim (plugins are missing since packdir is not set).
This PR makes it possible to revert to the old behavior with the
wrapStartupCommandsboolean in neovim's wrapper.This allows home-manager to generate an init.lua that can be picked up
by any neovim, not necessarily the one generated by home-manager.
2nd commit warns about wrapperArgs expecting an array instead of a string. Adds a depreciation notice.
Related home-manager PR ready as well.
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes