tpope / vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
https://www.vim.org/scripts/script.php?script_id=2975
20.1k stars 1.01k forks source link

Fugitive-specific git config #2235

Open igbanam opened 1 year ago

igbanam commented 1 year ago

Is there a way to pass some git configurations through to fugitive?

I'd like fugitive to use git without color — to avoid the weird color character embellishments in Vim — but have got with colour elsewhere.

The git config is color.ui = false. So I am looking for some configuration which would make fugitive run

git -c color.ui=false some-command

…whenever I run :GSomeCommand in fugitive.

Is this possible? If so, how so?

Thanks

tpope commented 1 year ago

You could probably stick options in g:fugitive_git_executable. But you don't need that for this: Set color.ui to auto and Git will only use color when connected to a terminal.

tpope commented 1 year ago

Also note that we do force the color options to false in most invocations of git, because color.ui=always is a common mistake. What command is giving you color escape escape sequences?

igbanam commented 1 year ago

Thanks for the suggestions!

I get the color escape sequences when I push. When I push, there's a link to create a PR. This link is colored. I'd like it to not be.

tpope commented 1 year ago

I get the color escape sequences when I push. When I push, there's a link to create a PR. This link is colored. I'd like it to not be.

Git doesn't do anything like this. It must be coming from the server. Which means it can't/won't respect Git options. 😔