mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-09 03:54:47 +08:00
Merge branch 'master' of git@github.com:mattn/zencoding-vim
This commit is contained in:
26
TUTORIAL
26
TUTORIAL
@@ -176,3 +176,29 @@ Tutorial of zencoding.vim
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
14. Enable zencoding.vim for language you using.
|
||||||
|
|
||||||
|
There are two ways to enable zencoding.vim for language you using.
|
||||||
|
|
||||||
|
1. Enable with filetype.
|
||||||
|
---------------------
|
||||||
|
# mkdir $HOME/.vim/ftplugin/php
|
||||||
|
# cp zencoding.vim $HOME/.vim/ftplugin/php/.
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
2. Enable with zen_settings.
|
||||||
|
---------------------
|
||||||
|
# cp zencoding.vim $HOME/.vim/.
|
||||||
|
# cat >> ~/.vimrc
|
||||||
|
let g:user_zen_settings = {
|
||||||
|
\ 'php' : {
|
||||||
|
\ 'extends' : 'html',
|
||||||
|
\ },
|
||||||
|
\ 'xml' : {
|
||||||
|
\ 'extends' : 'html',
|
||||||
|
\ },
|
||||||
|
\ 'haml' : {
|
||||||
|
\ 'extends' : 'html',
|
||||||
|
\ },
|
||||||
|
\}
|
||||||
|
---------------------
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" File: zencoding.vim
|
" File: zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 11-Mar-2010.
|
" Last Change: 12-Mar-2010.
|
||||||
" Version: 0.31
|
" Version: 0.32
|
||||||
" 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.
|
||||||
" SeeAlso: http://code.google.com/p/zen-coding/
|
" SeeAlso: http://code.google.com/p/zen-coding/
|
||||||
@@ -664,6 +664,7 @@ let s:zen_settings = {
|
|||||||
\ 'bdo:r': {'dir': 'rtl'},
|
\ 'bdo:r': {'dir': 'rtl'},
|
||||||
\ 'bdo:l': {'dir': 'ltr'},
|
\ 'bdo:l': {'dir': 'ltr'},
|
||||||
\ 'del': {'datetime': '${datetime}'},
|
\ 'del': {'datetime': '${datetime}'},
|
||||||
|
\ 'ins': {'datetime': '${datetime}'},
|
||||||
\ 'link:css': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|style.css'}, {'media': 'all'}],
|
\ 'link:css': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|style.css'}, {'media': 'all'}],
|
||||||
\ 'link:print': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|print.css'}, {'media': 'print'}],
|
\ 'link:print': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|print.css'}, {'media': 'print'}],
|
||||||
\ 'link:favicon': [{'rel': 'shortcut icon'}, {'type': 'image/x-icon'}, {'href': '|favicon.ico'}],
|
\ 'link:favicon': [{'rel': 'shortcut icon'}, {'type': 'image/x-icon'}, {'href': '|favicon.ico'}],
|
||||||
@@ -1153,9 +1154,9 @@ function! s:zen_toString(...)
|
|||||||
if len(tmp)
|
if len(tmp)
|
||||||
let str .= '{' . tmp . ' }'
|
let str .= '{' . tmp . ' }'
|
||||||
endif
|
endif
|
||||||
if stridx(','.s:zen_settings['html'].empty_elements.',', ','.current.name.',') != -1 && len(current.value) == 0
|
if stridx(','.s:zen_settings.html.empty_elements.',', ','.current.name.',') != -1 && len(current.value) == 0
|
||||||
let str .= "/"
|
let str .= "/"
|
||||||
elseif stridx(','.s:zen_settings['html'].block_elements.',', ','.current.name.',') != -1 && (len(current.child) == 0 && len(current.value) == 0)
|
elseif stridx(','.s:zen_settings.html.block_elements.',', ','.current.name.',') != -1 && (len(current.child) == 0 && len(current.value) == 0)
|
||||||
let str .= '<'
|
let str .= '<'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -1228,6 +1229,12 @@ function! s:zen_getFileType()
|
|||||||
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'
|
||||||
|
let type = 'javascript'
|
||||||
|
endif
|
||||||
|
if has_key(s:zen_settings, type) && has_key(s:zen_settings[type], 'extends')
|
||||||
|
let type = s:zen_settings[type].extends
|
||||||
|
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
|
||||||
@@ -1328,7 +1335,7 @@ function! s:zen_expandAbbr(mode) range
|
|||||||
endif
|
endif
|
||||||
if line[:-len(part)-1] =~ '^\s\+$'
|
if line[:-len(part)-1] =~ '^\s\+$'
|
||||||
let size = (len(line) - len(part)) / len(s:zen_settings.indentation)
|
let size = (len(line) - len(part)) / len(s:zen_settings.indentation)
|
||||||
let indent = line[:-len(part)-1] . repeat(s:zen_settings.indentation, size)
|
let indent = repeat(s:zen_settings.indentation, size)
|
||||||
else
|
else
|
||||||
let indent = ''
|
let indent = ''
|
||||||
endif
|
endif
|
||||||
@@ -1385,7 +1392,7 @@ function! s:zen_imageSize()
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let current = s:zen_parseTag(content)
|
let current = s:zen_parseTag(content)
|
||||||
let fn = current.attr['src']
|
let fn = current.attr.src
|
||||||
if fn !~ '^\(/\|http\)'
|
if fn !~ '^\(/\|http\)'
|
||||||
let fn = simplify(expand('%:h') . '/' . fn)
|
let fn = simplify(expand('%:h') . '/' . fn)
|
||||||
endif
|
endif
|
||||||
@@ -1418,8 +1425,8 @@ EOF
|
|||||||
if w == -1 && h == -1
|
if w == -1 && h == -1
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let current.attr['width'] = w
|
let current.attr.width = w
|
||||||
let current.attr['height'] = h
|
let current.attr.height = h
|
||||||
let html = s:zen_toString(current, 'html', 1)
|
let html = s:zen_toString(current, 'html', 1)
|
||||||
call s:change_content(img_region, html)
|
call s:change_content(img_region, html)
|
||||||
endfunction
|
endfunction
|
||||||
@@ -1650,7 +1657,7 @@ function! s:zen_anchorizeURL(flag)
|
|||||||
|
|
||||||
if a:flag == 0
|
if a:flag == 0
|
||||||
let a = s:zen_parseTag('<a>')
|
let a = s:zen_parseTag('<a>')
|
||||||
let a.attr['href'] = url
|
let a.attr.href = url
|
||||||
let a.value = '{' . title . '}'
|
let a.value = '{' . title . '}'
|
||||||
let expand = s:zen_toString(a, 'html', 0, '')
|
let expand = s:zen_toString(a, 'html', 0, '')
|
||||||
let expand = substitute(expand, '\${cursor}', '', 'g')
|
let expand = substitute(expand, '\${cursor}', '', 'g')
|
||||||
@@ -1661,7 +1668,7 @@ function! s:zen_anchorizeURL(flag)
|
|||||||
|
|
||||||
let blockquote = s:zen_parseTag('<blockquote class="quote">')
|
let blockquote = s:zen_parseTag('<blockquote class="quote">')
|
||||||
let a = s:zen_parseTag('<a>')
|
let a = s:zen_parseTag('<a>')
|
||||||
let a.attr['href'] = url
|
let a.attr.href = url
|
||||||
let a.value = '{' . title . '}'
|
let a.value = '{' . title . '}'
|
||||||
call add(blockquote.child, a)
|
call add(blockquote.child, a)
|
||||||
call add(blockquote.child, s:zen_parseTag('<br/>'))
|
call add(blockquote.child, s:zen_parseTag('<br/>'))
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ script_name: ZenCoding.vim
|
|||||||
script_id: '2981'
|
script_id: '2981'
|
||||||
script_type: utility
|
script_type: utility
|
||||||
script_package: zencoding.vim
|
script_package: zencoding.vim
|
||||||
script_version: '0.31'
|
script_version: '0.32'
|
||||||
required_vim_version: '7.0'
|
required_vim_version: '7.0'
|
||||||
summary: vim plugins for HTML and CSS hi-speed coding.
|
summary: vim plugins for HTML and CSS hi-speed coding.
|
||||||
|
|
||||||
@@ -81,6 +81,8 @@ install_details: |
|
|||||||
copy zencoding.vim to your plugin directory.
|
copy zencoding.vim to your plugin directory.
|
||||||
|
|
||||||
versions:
|
versions:
|
||||||
|
- '0.32': |
|
||||||
|
This is an upgrade for ZenCoding.vim: fixed indentation. supported extends so that you can enable zencoding for php/xhtml/haml other's section 14 in http://github.com/mattn/zencoding-vim/raw/master/TUTORIAL
|
||||||
- '0.31': |
|
- '0.31': |
|
||||||
This is an upgrade for ZenCoding.vim: fixed indentation and $$$ problem. fixed about missing support multiple classes.
|
This is an upgrade for ZenCoding.vim: fixed indentation and $$$ problem. fixed about missing support multiple classes.
|
||||||
- '0.30': |
|
- '0.30': |
|
||||||
|
|||||||
Reference in New Issue
Block a user