mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-08 19:44:47 +08:00
whitespace fix
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
"
|
"
|
||||||
" This is vim script support expanding abbreviation like zen-coding.
|
" This is vim script support expanding abbreviation like zen-coding.
|
||||||
" ref: http://code.google.com/p/zen-coding/
|
" ref: http://code.google.com/p/zen-coding/
|
||||||
"
|
"
|
||||||
" Type abbreviation
|
" Type abbreviation
|
||||||
" +-------------------------------------
|
" +-------------------------------------
|
||||||
" | html:5_
|
" | html:5_
|
||||||
@@ -42,12 +42,12 @@
|
|||||||
" | <div class="bar"></div>
|
" | <div class="bar"></div>
|
||||||
" |</div>
|
" |</div>
|
||||||
" +-------------------------------------
|
" +-------------------------------------
|
||||||
"
|
"
|
||||||
" Tips:
|
" Tips:
|
||||||
"
|
"
|
||||||
" You can customize behavior of expanding with overriding config.
|
" You can customize behavior of expanding with overriding config.
|
||||||
" This configuration will be marged at loading plugin.
|
" This configuration will be marged at loading plugin.
|
||||||
"
|
"
|
||||||
" let g:user_zen_settings = {
|
" let g:user_zen_settings = {
|
||||||
" \ 'indentation' : ' ',
|
" \ 'indentation' : ' ',
|
||||||
" \ 'perl' : {
|
" \ 'perl' : {
|
||||||
@@ -109,7 +109,7 @@ for s:item in [
|
|||||||
\ {'mode': 'i', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': '<esc>:call <sid>zen_anchorizeURL(1)<cr>a'},
|
\ {'mode': 'i', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': '<esc>:call <sid>zen_anchorizeURL(1)<cr>a'},
|
||||||
\ {'mode': 'n', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': ':call <sid>zen_anchorizeURL(1)<cr>'},
|
\ {'mode': 'n', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': ':call <sid>zen_anchorizeURL(1)<cr>'},
|
||||||
\]
|
\]
|
||||||
|
|
||||||
if !hasmapto('<plug>'.s:item.plug, s:item.mode)
|
if !hasmapto('<plug>'.s:item.plug, s:item.mode)
|
||||||
exe s:item.mode . 'noremap <plug>' . s:item.plug . ' ' . s:item.func
|
exe s:item.mode . 'noremap <plug>' . s:item.plug . ' ' . s:item.func
|
||||||
endif
|
endif
|
||||||
@@ -1369,16 +1369,16 @@ function! s:zen_getFileType()
|
|||||||
let type = &ft
|
let type = &ft
|
||||||
if type == 'xslt' | let type = 'xsl' | endif
|
if type == 'xslt' | let type = 'xsl' | endif
|
||||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^css'
|
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^css'
|
||||||
let type = 'css'
|
let type = 'css'
|
||||||
endif
|
endif
|
||||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^html'
|
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^html'
|
||||||
let type = 'html'
|
let type = 'html'
|
||||||
endif
|
endif
|
||||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^xml'
|
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^xml'
|
||||||
let type = 'xml'
|
let type = 'xml'
|
||||||
endif
|
endif
|
||||||
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^javaScript'
|
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^javaScript'
|
||||||
let type = 'javascript'
|
let type = 'javascript'
|
||||||
endif
|
endif
|
||||||
if len(type) == 0 | let type = 'html' | endif
|
if len(type) == 0 | let type = 'html' | endif
|
||||||
return type
|
return type
|
||||||
@@ -1420,7 +1420,7 @@ function! s:zen_expandAbbr(mode) range
|
|||||||
let expand = substitute(expand, '\$line\$', lpart, '')
|
let expand = substitute(expand, '\$line\$', lpart, '')
|
||||||
endfor
|
endfor
|
||||||
else
|
else
|
||||||
let str = ''
|
let str = ''
|
||||||
if a:firstline != a:lastline
|
if a:firstline != a:lastline
|
||||||
let line = getline(a:firstline)
|
let line = getline(a:firstline)
|
||||||
let part = substitute(line, '^\s*', '', '')
|
let part = substitute(line, '^\s*', '', '')
|
||||||
@@ -1476,7 +1476,7 @@ function! s:zen_expandAbbr(mode) range
|
|||||||
endif
|
endif
|
||||||
if len(expand)
|
if len(expand)
|
||||||
if expand !~ '\${cursor}'
|
if expand !~ '\${cursor}'
|
||||||
if a:mode == 2 |
|
if a:mode == 2 |
|
||||||
let expand = '${cursor}' . expand
|
let expand = '${cursor}' . expand
|
||||||
else
|
else
|
||||||
let expand .= '${cursor}'
|
let expand .= '${cursor}'
|
||||||
@@ -1557,7 +1557,7 @@ function! s:zen_imageSize()
|
|||||||
let fn = simplify(expand('%:h') . '/' . fn)
|
let fn = simplify(expand('%:h') . '/' . fn)
|
||||||
endif
|
endif
|
||||||
let [type, width, height] = ['', -1, -1]
|
let [type, width, height] = ['', -1, -1]
|
||||||
|
|
||||||
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
|
||||||
@@ -2094,7 +2094,7 @@ function! s:region_is_valid(region)
|
|||||||
return 1
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" search_region : make region from pattern which is composing start/end
|
" search_region : make region from pattern which is composing start/end
|
||||||
" this function return array of position
|
" this function return array of position
|
||||||
function! s:search_region(start, end)
|
function! s:search_region(start, end)
|
||||||
return [searchpos(a:start, 'bcnW'), searchpos(a:end, 'cneW')]
|
return [searchpos(a:start, 'bcnW'), searchpos(a:end, 'cneW')]
|
||||||
|
|||||||
Reference in New Issue
Block a user