1

I'm using Windows, in Git Bash, if I use vimdiff as the compare tool, Git will trigger the vimdiff in its package. However, it's hard to add a new color scheme, e.g. gruvbox.

Git's vim is in C:\Program Files\Git\usr\share\vim\vim82, by right I just need to add the gruvbox.vim into folder C:\Program Files\Git\usr\share\vim\vim82\colors\colors. However, due to company policy, this folder is readonly to me.

Is there a way to bypass it?

1
  • 1
    Read :help startup and put the colorscheme in your user configuration dir. Commented Apr 8 at 16:21

1 Answer 1

2

According to Friedrich's comment, "Read :help startup and put the colorscheme in your user configuration dir."

Help content shows:

Places for your personal initializations:
    Unix    $HOME/.vimrc or $HOME/.vim/vimrc
    OS/2    $HOME/.vimrc, $HOME/vimfiles/vimrc or $VIM/.vimrc (or _vimrc)
    MS-Windows  $HOME/_vimrc, $HOME/vimfiles/vimrc or $VIM/_vimrc
    Amiga   s:.vimrc, home:.vimrc, home:vimfiles:vimrc or $VIM/.vimrc

The files are searched in the order specified above and only the first one that is found is read.

RECOMMENDATION: Put all your Vim configuration stuff in the $HOME/.vim/ directory ($HOME/vimfiles/ for MS-Windows). That makes it   easy to copy it to another system.

So indeed, if I'm running vimdiff from Git Bash, as there's Bash, vimdiff thinks it's in Unix, so gruvbox.vim shall be placed in $HOME/.vim/colors, i.e. C:\Users\UserName\.vim\colors.

Similarly, if I'm running vim directly from C:/Program Files/vim/vim82/gvim.exe, vimdiff thinks it's in MS-Windows, gruvbox.vim shall be placed in $HOME/vimfiles/colors, i.e. C:\Users\UserName\vimfiles\colors.

Sign up to request clarification or add additional context in comments.

2 Comments

not a problem at all, it's fun solving issues. thanks for the tip! @Friedrich

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.