mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-09 03:54:47 +08:00
pre-expand '#header>li<#content' to 'div#header>li<div#content'.
This commit is contained in:
@@ -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: 23-Feb-2010.
|
" Last Change: 24-Feb-2010.
|
||||||
" Version: 0.22
|
" Version: 0.23
|
||||||
" 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/
|
||||||
@@ -90,7 +90,7 @@ if !hasmapto(g:user_zen_expandabbr_key, 'v')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('s:zen_settings')
|
if exists('s:zen_settings')
|
||||||
finish
|
"finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
unlet! s:zen_settings
|
unlet! s:zen_settings
|
||||||
@@ -822,7 +822,8 @@ function! s:zen_parseIntoTree(abbr, type)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let abbr = substitute(abbr, '\([a-z][a-z0-9]*\)\++\{-}$', '\=s:zen_expandos(submatch(1), type)', 'i')
|
let abbr = substitute(abbr, '\([a-z][a-z0-9]*\)\++\{-}$', '\=s:zen_expandos(submatch(1), type)', 'i')
|
||||||
let mx = '\([\+>#]\|<\+\)\{-}\s*\(@\{-}[a-z][a-z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[0-9A-Za-z_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[0-9A-Za-z_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\*\([0-9]\+\)\)\{0,1}'
|
let abbr = substitute(abbr, '\(\%([+<>]\+\|^\)\s*\)#', '\1div#', 'g')
|
||||||
|
let mx = '\([+<>]\)\{-}\s*\(@\{-}[a-z][a-z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[0-9A-Za-z_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[0-9A-Za-z_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\*\([0-9]\+\)\)\{0,1}'
|
||||||
let last = {}
|
let last = {}
|
||||||
let parent = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'brother': 0 }
|
let parent = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'brother': 0 }
|
||||||
let granma = parent
|
let granma = parent
|
||||||
@@ -838,10 +839,9 @@ function! s:zen_parseIntoTree(abbr, type)
|
|||||||
if len(str) == 0
|
if len(str) == 0
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
if operator == '#'
|
if tag_name =~ '^#'
|
||||||
let attributes = '#' . tag_name . attributes
|
let attributes = tag_name . attributes
|
||||||
let tag_name = 'div'
|
let tag_name = 'div'
|
||||||
let operator = ''
|
|
||||||
endif
|
endif
|
||||||
if multiplier <= 0
|
if multiplier <= 0
|
||||||
let multiplier = 1
|
let multiplier = 1
|
||||||
@@ -1182,5 +1182,7 @@ endif
|
|||||||
"echo ZenExpand('fs:n', 'css')
|
"echo ZenExpand('fs:n', 'css')
|
||||||
"echo ZenExpand('link:css', '')
|
"echo ZenExpand('link:css', '')
|
||||||
"echo ZenExpand('ul+', '')
|
"echo ZenExpand('ul+', '')
|
||||||
|
"echo ZenExpand('#header>li<#content', '')
|
||||||
|
"echo ZenExpand('(#header>li)<#content', '')
|
||||||
|
|
||||||
" vim:set et:
|
" vim:set et:
|
||||||
|
|||||||
@@ -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.22'
|
script_version: '0.23'
|
||||||
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.
|
||||||
|
|
||||||
@@ -78,6 +78,8 @@ install_details: |
|
|||||||
copy zencoding.vim to your plugin directory.
|
copy zencoding.vim to your plugin directory.
|
||||||
|
|
||||||
versions:
|
versions:
|
||||||
|
- '0.23': |
|
||||||
|
This is an upgrade for ZenCoding.vim: pre-expand '#header>li<#content' to 'div#header>li<div#content'.
|
||||||
- '0.22': |
|
- '0.22': |
|
||||||
This is an upgrade for ZenCoding.vim: expand 'ul+' to 'ul>li'. fix undo ring. support visual selection. when type trigger key on visual select, it request you leader like 'ul>li'. if you give 'ul>li*' as leader, you'll get each separate 'ul>li' tags. and when you give 'blockquote' as leader, you'll get blocked text.
|
This is an upgrade for ZenCoding.vim: expand 'ul+' to 'ul>li'. fix undo ring. support visual selection. when type trigger key on visual select, it request you leader like 'ul>li'. if you give 'ul>li*' as leader, you'll get each separate 'ul>li' tags. and when you give 'blockquote' as leader, you'll get blocked text.
|
||||||
- '0.21': |
|
- '0.21': |
|
||||||
|
|||||||
Reference in New Issue
Block a user