7

We have have this neat little script at work that let's us use the internet over proxy from the linux enviroment. For example

withproxy git clone https://github.com/VundleVim/Vundle.vim.git

works just fine and doesn't even prompt me for my username and password.

How do I set this up within the .vimrc for Vundle so that all the git things are prefixed by this proxy script?

Joachim
  • 3,210
  • 4
  • 28
  • 43

1 Answers1

10

How do I set this up within the .vimrc for Vundle so that all the git things are prefixed by this proxy script?

You don't. What you do instead is make git go through the proxy:

git config --global http.proxy http://username:password@proxy.example.com:8080

You can also set the environment variable http_proxy to the same thing:

export http_proxy='http://username:password@proxy.example.com:8080'

You might also need a https_proxy if you do it this way.

lcd047
  • 5,731
  • 2
  • 28
  • 38
  • For socks proxy, just add `ALL_PROXY=socks5://127.0.0.1:1080` before the vim command. see, [using-a-socks-proxy-with-git-for-the-http-transport](https://stackoverflow.com/questions/15227130/using-a-socks-proxy-with-git-for-the-http-transport#33077497). For example, I use [vim-plug](https://github.com/junegunn/vim-plug) with `:PlugInstall` to install `wakatime/vim-wakatime`. I tried `ALL_PROXY=socks5://127.0.0.1:8888 vim`, then run `:PlugInstall` in vim and `vim-plug` will use the socks proxy. It works for me. – Nick Dong Aug 28 '21 at 09:52