Is your feature request related to a problem? Please describe.
I'm using Neovim on a cloud instance at work. This instance does some funky things with git mirrors, so by default the git commands only work for our private repos and will fail for anything on public github (like Neovim plugins, for instance). I can work around this by setting the GIT_CONFIG_NOSYSTEM=1 environment variable. I don't want to do that globally (using vim.env), because then git commands in other plugins will fail when interacting with my work repos. I only want those environment variables set for fetching/updating Neovim plugins.
Describe the solution you'd like
I would like to have a config option for passing environment variables to the git commands. For example:
git = {
-- Existing options
log = { "--since=3 days ago" },
timeout = 120,
-- The new option
env = {
GIT_CONFIG_NOSYSTEM = "1",
}
}
Describe alternatives you've considered
I previously submitted a PR to packer.nvim for this feature: https://github.com/wbthomason/packer.nvim/pull/1057
As it was pointed out, I could instead create a wrapper script that sets the environment variable and then invokes git. I would prefer not to do this because I'm using this in a kickstart-like single-file init.lua example that I'm putting up as a reference for others at the company, and don't want to add the clutter that would entail.
Additional context
I'm happy to create the PR! I just want to check with you first that this is something you would consider merging.
Did you check the docs?
Is your feature request related to a problem? Please describe.
I'm using Neovim on a cloud instance at work. This instance does some funky things with git mirrors, so by default the git commands only work for our private repos and will fail for anything on public github (like Neovim plugins, for instance). I can work around this by setting the
GIT_CONFIG_NOSYSTEM=1
environment variable. I don't want to do that globally (usingvim.env
), because then git commands in other plugins will fail when interacting with my work repos. I only want those environment variables set for fetching/updating Neovim plugins.Describe the solution you'd like
I would like to have a config option for passing environment variables to the git commands. For example:
Describe alternatives you've considered
I previously submitted a PR to packer.nvim for this feature: https://github.com/wbthomason/packer.nvim/pull/1057 As it was pointed out, I could instead create a wrapper script that sets the environment variable and then invokes git. I would prefer not to do this because I'm using this in a kickstart-like single-file init.lua example that I'm putting up as a reference for others at the company, and don't want to add the clutter that would entail.
Additional context
I'm happy to create the PR! I just want to check with you first that this is something you would consider merging.