Skip to content

Instantly share code, notes, and snippets.

@osyo-manga
Created June 18, 2013 13:46
Show Gist options
  • Select an option

  • Save osyo-manga/5805484 to your computer and use it in GitHub Desktop.

Select an option

Save osyo-manga/5805484 to your computer and use it in GitHub Desktop.
augroup Network
autocmd!
augroup END
augroup test
autocmd!
autocmd SourceCmd https://* call s:source_web_file(substitute(expand("<afile>"), '\\', '/', 'g'))
autocmd SourceCmd http://* call s:source_web_file(substitute(expand("<afile>"), '\\', '/', 'g'))
augroup END
function! s:source_web_file(uri)
let temp = tempname()
call system(printf("curl %s -o %s", a:uri, temp))
source `=temp`
endfunction
" source https://gist.github.com/osyo-manga/5805362/raw/38ca08e6240e0a985c980e2b821e196002f9fd57/test.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment