Last active
June 14, 2017 17:22
-
-
Save watagashi/449d3a1ecbbcdb4f0a7209c3a9298564 to your computer and use it in GitHub Desktop.
TwitVim のプロキシ設定を環境変数から設定 ref: http://qiita.com/watagashi/items/0bd0d4d763ea774d97a5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: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