mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 11:14:26 +08:00
detect type from syntax
This commit is contained in:
@@ -1133,6 +1133,15 @@ endfunction
|
|||||||
|
|
||||||
function! s:zen_getFileType()
|
function! s:zen_getFileType()
|
||||||
let type = &ft
|
let type = &ft
|
||||||
|
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^css'
|
||||||
|
let type = 'css'
|
||||||
|
endif
|
||||||
|
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^html'
|
||||||
|
let type = 'html'
|
||||||
|
endif
|
||||||
|
if synIDattr(synID(line("."), col("."), 1), "name") =~ '^xml'
|
||||||
|
let type = 'xml'
|
||||||
|
endif
|
||||||
if len(type) == 0 | let type = 'html' | endif
|
if len(type) == 0 | let type = 'html' | endif
|
||||||
if type == 'xhtml' | let type = 'html' | endif
|
if type == 'xhtml' | let type = 'html' | endif
|
||||||
return type
|
return type
|
||||||
@@ -1246,6 +1255,7 @@ function! s:zen_expandAbbr(mode) range
|
|||||||
call append(line('.'), lines[1:])
|
call append(line('.'), lines[1:])
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
silent! exe "normal! ".len(part)."h"
|
||||||
if search('|')
|
if search('|')
|
||||||
silent! exe "normal! a\<c-h>"
|
silent! exe "normal! a\<c-h>"
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user