forked from VimPlug/emmet-vim
g:zencoding_curl_command
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" zencoding.vim
|
" zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 22-Sep-2011.
|
" Last Change: 26-Sep-2011.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
@@ -779,7 +779,7 @@ function! zencoding#imageSize()
|
|||||||
if filereadable(fn)
|
if filereadable(fn)
|
||||||
let hex = substitute(system('xxd -p "'.fn.'"'), '\n', '', 'g')
|
let hex = substitute(system('xxd -p "'.fn.'"'), '\n', '', 'g')
|
||||||
else
|
else
|
||||||
let hex = substitute(system('curl -s "'.fn.'" | xxd -p'), '\n', '', 'g')
|
let hex = substitute(system(g:zencoding_curl_command.' "'.fn.'" | xxd -p'), '\n', '', 'g')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if hex =~ '^89504e470d0a1a0a'
|
if hex =~ '^89504e470d0a1a0a'
|
||||||
@@ -1089,7 +1089,7 @@ endfunction
|
|||||||
"==============================================================================
|
"==============================================================================
|
||||||
function! s:get_content_from_url(url)
|
function! s:get_content_from_url(url)
|
||||||
silent! new
|
silent! new
|
||||||
silent! exec '0r!curl -s -L "'.substitute(a:url, '#.*', '', '').'"'
|
silent! exec '0r!'.g:zencoding_curl_command.' "'.substitute(a:url, '#.*', '', '').'"'
|
||||||
let ret = join(getline(1, '$'), "\n")
|
let ret = join(getline(1, '$'), "\n")
|
||||||
silent! bw!
|
silent! bw!
|
||||||
return ret
|
return ret
|
||||||
@@ -1110,7 +1110,7 @@ function! s:get_text_from_html(buf)
|
|||||||
let m = split(buf, mx)
|
let m = split(buf, mx)
|
||||||
for str in m
|
for str in m
|
||||||
let c = split(str, '<[^>]*?>')
|
let c = split(str, '<[^>]*?>')
|
||||||
let str = substitute(str, '<[^>]\{-}>', '', 'g')
|
let str = substitute(str, '<[^>]\{-}>', ' ', 'g')
|
||||||
let str = substitute(str, '>', '>', 'g')
|
let str = substitute(str, '>', '>', 'g')
|
||||||
let str = substitute(str, '<', '<', 'g')
|
let str = substitute(str, '<', '<', 'g')
|
||||||
let str = substitute(str, '"', '"', 'g')
|
let str = substitute(str, '"', '"', 'g')
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" File: zencoding.vim
|
" File: zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 22-Sep-2011.
|
" Last Change: 26-Sep-2011.
|
||||||
" Version: 0.54
|
" Version: 0.54
|
||||||
" WebPage: http://github.com/mattn/zencoding-vim
|
" WebPage: http://github.com/mattn/zencoding-vim
|
||||||
" Description: vim plugins for HTML and CSS hi-speed coding.
|
" Description: vim plugins for HTML and CSS hi-speed coding.
|
||||||
@@ -78,6 +78,10 @@ if !exists('g:zencoding_debug')
|
|||||||
let g:zencoding_debug = 0
|
let g:zencoding_debug = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:zencoding_curl_command')
|
||||||
|
let g:zencoding_curl_command = 'curl -s -L'
|
||||||
|
endif
|
||||||
|
|
||||||
if exists('g:use_zen_complete_tag') && g:use_zen_complete_tag
|
if exists('g:use_zen_complete_tag') && g:use_zen_complete_tag
|
||||||
setlocal omnifunc=zencoding#CompleteTag
|
setlocal omnifunc=zencoding#CompleteTag
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user