mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 11:14:26 +08:00
indentation for each languages. replace $$$ as '111'.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
" File: zencoding.vim
|
" File: zencoding.vim
|
||||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
" Last Change: 22-Feb-2010.
|
" Last Change: 22-Feb-2010.
|
||||||
" Version: 0.13
|
" Version: 0.14
|
||||||
" 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/
|
||||||
@@ -927,15 +927,19 @@ function! s:zen_toString(...)
|
|||||||
endif
|
endif
|
||||||
if len(type) == 0 | let type = 'html' | endif
|
if len(type) == 0 | let type = 'html' | endif
|
||||||
|
|
||||||
|
if has_key(s:zen_settings[type], 'indentation')
|
||||||
|
let indent = s:zen_settings[type]['indentation']
|
||||||
|
else
|
||||||
let indent = s:zen_settings['indentation']
|
let indent = s:zen_settings['indentation']
|
||||||
|
endif
|
||||||
let m = 0
|
let m = 0
|
||||||
let str = ''
|
let str = ''
|
||||||
while m < current['multiplier']
|
while m < current['multiplier']
|
||||||
if len(current['name']) && type == 'html'
|
if len(current['name']) && type == 'html'
|
||||||
let str .= '<' . current['name']
|
let str .= '<' . current['name']
|
||||||
for attr in keys(current['attr'])
|
for attr in keys(current['attr'])
|
||||||
if current['multiplier'] > 1 && current['attr'][attr] =~ '\$$'
|
if current['multiplier'] > 1 && current['attr'][attr] =~ '\$'
|
||||||
let str .= ' ' . attr . '="' . current['attr'][attr][:-2] . (m+1) . '"'
|
let str .= ' ' . attr . '="' . substitute(current['attr'][attr], '\$', m+1, 'g') . '"'
|
||||||
else
|
else
|
||||||
let str .= ' ' . attr . '="' . current['attr'][attr] . '"'
|
let str .= ' ' . attr . '="' . current['attr'][attr] . '"'
|
||||||
endif
|
endif
|
||||||
@@ -1092,5 +1096,6 @@ endif
|
|||||||
"echo ZenExpand('div#header + div#footer', '')
|
"echo ZenExpand('div#header + div#footer', '')
|
||||||
"echo ZenExpand('#header + div#footer', '')
|
"echo ZenExpand('#header + div#footer', '')
|
||||||
"echo ZenExpand('#header > ul > li < p{Footer}', '')
|
"echo ZenExpand('#header > ul > li < p{Footer}', '')
|
||||||
|
"echo ZenExpand('a#foo$$$*3', '')
|
||||||
|
|
||||||
" vim:set et:
|
" vim:set et:
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ install_details: |
|
|||||||
copy zencoding.vim to your plugin directory.
|
copy zencoding.vim to your plugin directory.
|
||||||
|
|
||||||
versions:
|
versions:
|
||||||
|
- '0.14': |
|
||||||
|
This is an upgrade for ZenCoding.vim: indentation for each languages.
|
||||||
- '0.13': |
|
- '0.13': |
|
||||||
This is an upgrade for ZenCoding.vim: user key map.
|
This is an upgrade for ZenCoding.vim: user key map.
|
||||||
- '0.12': |
|
- '0.12': |
|
||||||
|
|||||||
Reference in New Issue
Block a user