folke / lazy.nvim

💤 A modern plugin manager for Neovim
https://lazy.folke.io/
Apache License 2.0
15.14k stars 366 forks source link

feature: Hooks for modal UI #1162

Closed pedropombeiro closed 10 months ago

pedropombeiro commented 1 year ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

When I start vim from the home directory, I have it set the GIT_DIR environment variable to my yadm dotfiles git repository location, so that invoking LazyGit from the editor works as expected. However, I noticed that this breaks the functionality when you can see commit diffs on Lazy plugin updates (the window shows empty when I press d).

Describe the solution you'd like

I'd like Lazy to ignore GIT_DIR when performing Git operations, since it probably doesn't make sense for GIT_DIR to be interfering with Git operations when Lazy is doing its thing anyway.

Describe alternatives you've considered

Another alternatice is for me to be able to save the value of vim.env.GIT_DIR and set it to nil before invoking Lazy, and restoring the value once the Lazy UI is closed. If these hooks were exposed as User Events, it could be feasible.

Additional context

No response

folke commented 10 months ago

This doesn't make any sense to me.

You're effectively configuring every git operation to use a certain GIT_DIR.

Why not simply adding that GIT_DIR env var only for lazygit?

Eitherway, not interested in adding this