Skip to content

Instantly share code, notes, and snippets.

@watagashi
Last active June 14, 2017 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save watagashi/449d3a1ecbbcdb4f0a7209c3a9298564 to your computer and use it in GitHub Desktop.
Save watagashi/449d3a1ecbbcdb4f0a7209c3a9298564 to your computer and use it in GitHub Desktop.
TwitVim のプロキシ設定を環境変数から設定 ref: http://qiita.com/watagashi/items/0bd0d4d763ea774d97a5
if exists('$HTTP_PROXY')
let s:proxy_url_pattern =
\ '^\%(\([^:]*\):\/\/\)\='
\ . '\%(\([^:@]*\)\(:[^@]*\)\=@\)\='
\ . '\([^:]*\)\%(:\(\d*\)\)\=/\=$'
let g:twitvim_proxy = substitute($HTTP_PROXY,
\ s:proxy_url_pattern, '\4:\5', '')
let s:proxy_login = substitute($HTTP_PROXY,
\ s:proxy_url_pattern, '\2', '')
let s:proxy_pass = substitute($HTTP_PROXY,
\ s:proxy_url_pattern, '\3', '')
let g:twitvim_proxy_login = substitute(s:proxy_login . s:proxy_pass,
\ '%40', '@', 'g')
endif
:help twitvim_proxy
:help twitvim_proxy_login
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment