From 5f4ed21ddec8a9c987c068c2b8f445c36e7456f3 Mon Sep 17 00:00:00 2001 From: mattn Date: Mon, 8 Mar 2010 16:56:37 +0900 Subject: [PATCH] detect type from syntax --- zencoding.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zencoding.vim b/zencoding.vim index fed17d5..9cfef83 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -1133,6 +1133,15 @@ endfunction function! s:zen_getFileType() 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 type == 'xhtml' | let type = 'html' | endif return type @@ -1246,6 +1255,7 @@ function! s:zen_expandAbbr(mode) range call append(line('.'), lines[1:]) endif endif + silent! exe "normal! ".len(part)."h" if search('|') silent! exe "normal! a\" endif