Skip to content

neovim: dont wrap the configuration, write it in ~/.config/nvim to not stray away from the typical neovim workflow#5964

Closed
teto wants to merge 2 commits intonix-community:masterfrom
teto:teto/neovim-xdg-plugins-not-wrapped
Closed

neovim: dont wrap the configuration, write it in ~/.config/nvim to not stray away from the typical neovim workflow#5964
teto wants to merge 2 commits intonix-community:masterfrom
teto:teto/neovim-xdg-plugins-not-wrapped

Conversation

@teto
Copy link
Copy Markdown
Collaborator

@teto teto commented Oct 15, 2024

Description

2nd attempt at:

HM wraps the neovim executable with its config, which is a pain because nvim
behaves a bit different with -u, also it prevents neovim GUIs to load your
config unless you wrap them too (painful).

Requires NixOS/nixpkgs#348740

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@teto teto force-pushed the teto/neovim-xdg-plugins-not-wrapped branch from 8988fb3 to 4557434 Compare October 16, 2024 13:55
@teto teto mentioned this pull request Oct 21, 2024
6 tasks
@teto teto changed the title neovim xdg plugins not wrapped neovim: dont wrap the configuration, write it in ~/.config/nvim to not stray away from the typical neovim workflow Nov 23, 2024
@c3n21
Copy link
Copy Markdown

c3n21 commented Jan 21, 2025

Would it be possible to make this change opt-in?

@teto
Copy link
Copy Markdown
Collaborator Author

teto commented Jan 21, 2025

Would it be possible to make this change opt-in?

why ? no. The current way makes no sense IMO, i.e., it just installs "one" neovim, regardless of anything user-specific. It surprises all users and is the source of a lot of confusion.

Note that in the past week, the nixpkgs documentation for the neovim wrapper has improved significantly and creating your custom neovim should be a lot easier. One could even use NVIM_APPNAME to keep some imperative config different from the default neovim folders.

@teto teto force-pushed the teto/neovim-xdg-plugins-not-wrapped branch 3 times, most recently from be96eb0 to 583f3b2 Compare February 6, 2025 22:52
teto added 2 commits February 7, 2025 00:12
See previous attempt at nix-community#3717  and its revert at nix-community#3817

- link the packpath in expected folder so that even unwrapped neovim can pick home-manager's plugins.

Right now the path to plugins (`:h rtp` / `:h packpath`) is set in the neovim wrapper.
Not only is this unusual but if you want to run an unwrapped neovim (a neovim GUI or when you hack on neovim for instance),
the app doesn't find plugins installed by home-manager.
With this change, neovim can discover HM-installed plugins by itself and
hopefully we can make neovim configuration less magical and surprising
to newcomers.
make test TEST=neovim-plugin-config

- would previously use `-u` which we precisely want to avoid relying on
because of side-effects.
Likewise,  `-es` skips some initialization phase (see `:h startup`).
- Instead of several stdout redirections, write to a file directly.
- also logs more via -V3$out/log.txt to help debug
@teto teto force-pushed the teto/neovim-xdg-plugins-not-wrapped branch from 583f3b2 to accbbb4 Compare February 6, 2025 23:12
@stale
Copy link
Copy Markdown

stale bot commented Jul 18, 2025

Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.

If you are the original author of the PR

  • GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
  • If it is unfinished but you plan to finish it, please mark it as a draft.
  • If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
  • To get things rolling again, rebase the PR against the target branch and address valid comments.

If you are not the original author of the PR

  • If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.

@stale stale bot added the status: stale label Jul 18, 2025
teto added a commit to teto/nixpkgs that referenced this pull request Dec 14, 2025
In home-manager we dont want to add "--set packpatk/rtp" otherwise
packages are loaded twice see:
nix-community/home-manager#5964

Since the wrapper args are easily added by the user (by using `finalAttrs.packpathDirs`), I propose
we dont set them when wrapRc is set as well.
teto added a commit to teto/nixpkgs that referenced this pull request Dec 17, 2025
In home-manager we dont want to add "--set packpatk/rtp" otherwise
packages are loaded twice see:
nix-community/home-manager#5964

Since the wrapper args are easily added by the user (by using `finalAttrs.packpathDirs`), I propose
we dont set them when wrapRc is set as well.
@teto teto mentioned this pull request Jan 17, 2026
9 tasks
@teto
Copy link
Copy Markdown
Collaborator Author

teto commented Jan 22, 2026

done in #8586 and #8606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants