mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 19:24:27 +08:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fe726da47 | ||
|
|
451367a2ce | ||
|
|
f752a4250c | ||
|
|
1672e5664c | ||
|
|
5819343b88 | ||
|
|
913dfe686d | ||
|
|
603d6e4fcd | ||
|
|
136b87a330 | ||
|
|
5eb1061a3d | ||
|
|
4110fb0f7b | ||
|
|
1691ccc7e8 | ||
|
|
0bd0a38a29 | ||
|
|
13b842d9c4 | ||
|
|
fceb37243a | ||
|
|
abdf10e91c | ||
|
|
333fede99b | ||
|
|
037c7e5720 | ||
|
|
5041c20aae | ||
|
|
77747c762a | ||
|
|
4933347202 | ||
|
|
1c240c6d6d | ||
|
|
2c429485ec | ||
|
|
7a9412d3da | ||
|
|
6e1175326e | ||
|
|
cee9e9d6c8 | ||
|
|
0617f58dd6 |
@@ -126,31 +126,52 @@ endfunction
|
|||||||
|
|
||||||
function! emmet#mergeConfig(lhs, rhs) abort
|
function! emmet#mergeConfig(lhs, rhs) abort
|
||||||
let [lhs, rhs] = [a:lhs, a:rhs]
|
let [lhs, rhs] = [a:lhs, a:rhs]
|
||||||
if type(lhs) ==# 3 && type(rhs) ==# 3
|
if type(lhs) ==# 3
|
||||||
let lhs += rhs
|
if type(rhs) ==# 3
|
||||||
if len(lhs)
|
let lhs += rhs
|
||||||
call remove(lhs, 0, len(lhs)-1)
|
if len(lhs)
|
||||||
|
call remove(lhs, 0, len(lhs)-1)
|
||||||
|
endif
|
||||||
|
for rhi in rhs
|
||||||
|
call add(lhs, rhs[rhi])
|
||||||
|
endfor
|
||||||
|
elseif type(rhs) ==# 4
|
||||||
|
let lhs += map(keys(rhs), '{v:val : rhs[v:val]}')
|
||||||
endif
|
endif
|
||||||
for rhi in rhs
|
elseif type(lhs) ==# 4
|
||||||
call add(lhs, rhs[rhi])
|
if type(rhs) ==# 3
|
||||||
endfor
|
for V in rhs
|
||||||
elseif type(lhs) ==# 4 && type(rhs) ==# 4
|
if type(V) != 4
|
||||||
for key in keys(rhs)
|
continue
|
||||||
if type(rhs[key]) ==# 3
|
|
||||||
if !has_key(lhs, key)
|
|
||||||
let lhs[key] = []
|
|
||||||
endif
|
endif
|
||||||
let lhs[key] += rhs[key]
|
for k in keys(V)
|
||||||
elseif type(rhs[key]) ==# 4
|
let lhs[k] = V[k]
|
||||||
if has_key(lhs, key)
|
endfor
|
||||||
call emmet#mergeConfig(lhs[key], rhs[key])
|
endfor
|
||||||
|
elseif type(rhs) ==# 4
|
||||||
|
for key in keys(rhs)
|
||||||
|
if type(rhs[key]) ==# 3
|
||||||
|
if !has_key(lhs, key)
|
||||||
|
let lhs[key] = []
|
||||||
|
endif
|
||||||
|
if type(lhs[key]) == 3
|
||||||
|
let lhs[key] += rhs[key]
|
||||||
|
elseif type(lhs[key]) == 4
|
||||||
|
for k in keys(rhs[key])
|
||||||
|
let lhs[key][k] = rhs[key][k]
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
elseif type(rhs[key]) ==# 4
|
||||||
|
if has_key(lhs, key)
|
||||||
|
call emmet#mergeConfig(lhs[key], rhs[key])
|
||||||
|
else
|
||||||
|
let lhs[key] = rhs[key]
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
let lhs[key] = rhs[key]
|
let lhs[key] = rhs[key]
|
||||||
endif
|
endif
|
||||||
else
|
endfor
|
||||||
let lhs[key] = rhs[key]
|
endif
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -269,6 +290,7 @@ function! emmet#toString(...) abort
|
|||||||
else
|
else
|
||||||
let inner = current.value[1:-2]
|
let inner = current.value[1:-2]
|
||||||
endif
|
endif
|
||||||
|
let inner = substitute(inner, '\${child}', '', '')
|
||||||
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
let inner = substitute(inner, "\n", "\n" . indent, 'g')
|
||||||
let str = substitute(str, '\${child}', inner, '')
|
let str = substitute(str, '\${child}', inner, '')
|
||||||
endif
|
endif
|
||||||
@@ -290,8 +312,18 @@ function! emmet#getResource(type, name, default) abort
|
|||||||
if exists('b:emmet_' . a:name)
|
if exists('b:emmet_' . a:name)
|
||||||
return get(b:, 'emmet_' . a:name)
|
return get(b:, 'emmet_' . a:name)
|
||||||
endif
|
endif
|
||||||
|
let global = {}
|
||||||
|
if has_key(s:emmet_settings, '*') && has_key(s:emmet_settings['*'], a:name)
|
||||||
|
let global = extend(global, s:emmet_settings['*'][a:name])
|
||||||
|
endif
|
||||||
|
|
||||||
for type in split(a:type, '\.')
|
if has_key(s:emmet_settings, a:type)
|
||||||
|
let types = [a:type]
|
||||||
|
else
|
||||||
|
let types = split(a:type, '\.')
|
||||||
|
endif
|
||||||
|
|
||||||
|
for type in types
|
||||||
if !has_key(s:emmet_settings, type)
|
if !has_key(s:emmet_settings, type)
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
@@ -318,22 +350,36 @@ function! emmet#getResource(type, name, default) abort
|
|||||||
if has_key(s:emmet_settings[type], a:name)
|
if has_key(s:emmet_settings[type], a:name)
|
||||||
if type(ret) ==# 3 || type(ret) ==# 4
|
if type(ret) ==# 3 || type(ret) ==# 4
|
||||||
call emmet#mergeConfig(ret, s:emmet_settings[type][a:name])
|
call emmet#mergeConfig(ret, s:emmet_settings[type][a:name])
|
||||||
|
return extend(global, ret)
|
||||||
else
|
else
|
||||||
let ret = s:emmet_settings[type][a:name]
|
return s:emmet_settings[type][a:name]
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if !empty(ret)
|
if !empty(ret)
|
||||||
|
if type(ret) ==# 3 || type(ret) ==# 4
|
||||||
|
let ret = extend(global, ret)
|
||||||
|
endif
|
||||||
return ret
|
return ret
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return a:default
|
let ret = a:default
|
||||||
|
if type(ret) ==# 3 || type(ret) ==# 4
|
||||||
|
let ret = extend(global, ret)
|
||||||
|
endif
|
||||||
|
return ret
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#getFileType(...) abort
|
function! emmet#getFileType(...) abort
|
||||||
let flg = get(a:000, 0, 0)
|
let flg = get(a:000, 0, 0)
|
||||||
let type = ''
|
let type = ''
|
||||||
for part in split(&filetype, '\.')
|
|
||||||
|
if has_key(s:emmet_settings, &filetype)
|
||||||
|
let types = [&filetype]
|
||||||
|
else
|
||||||
|
let types = split(&filetype, '\.')
|
||||||
|
endif
|
||||||
|
for part in types
|
||||||
if emmet#lang#exists(part)
|
if emmet#lang#exists(part)
|
||||||
let type = part
|
let type = part
|
||||||
break
|
break
|
||||||
@@ -496,8 +542,12 @@ function! emmet#expandAbbr(mode, abbr) range abort
|
|||||||
let spl = ''
|
let spl = ''
|
||||||
endif
|
endif
|
||||||
let items = emmet#parseIntoTree(query, type).child
|
let items = emmet#parseIntoTree(query, type).child
|
||||||
|
let itemno = 0
|
||||||
for item in items
|
for item in items
|
||||||
let expand .= emmet#toString(item, rtype, 0, filters, 0, indent)
|
let inner = emmet#toString(item, rtype, 0, filters, 0, indent)
|
||||||
|
let inner = substitute(inner, '\$#', '$line'.(itemno*(a:lastline - a:firstline + 1)/len(items)+1).'$', 'g')
|
||||||
|
let expand .= inner
|
||||||
|
let itemno = itemno + 1
|
||||||
endfor
|
endfor
|
||||||
if emmet#useFilter(filters, 'e')
|
if emmet#useFilter(filters, 'e')
|
||||||
let expand = substitute(expand, '&', '\&', 'g')
|
let expand = substitute(expand, '&', '\&', 'g')
|
||||||
@@ -674,7 +724,7 @@ function! emmet#expandAbbr(mode, abbr) range abort
|
|||||||
if g:emmet_debug > 1
|
if g:emmet_debug > 1
|
||||||
call getchar()
|
call getchar()
|
||||||
endif
|
endif
|
||||||
if search('\ze\$\(cursor\|select\)\$')
|
if search('\ze\$\(cursor\|select\)\$', 'c')
|
||||||
let oldselection = &selection
|
let oldselection = &selection
|
||||||
let &selection = 'inclusive'
|
let &selection = 'inclusive'
|
||||||
if foldclosed(line('.')) !=# -1
|
if foldclosed(line('.')) !=# -1
|
||||||
@@ -1577,8 +1627,7 @@ let s:emmet_settings = {
|
|||||||
\ 'extends': 'css',
|
\ 'extends': 'css',
|
||||||
\ },
|
\ },
|
||||||
\ 'html': {
|
\ 'html': {
|
||||||
\ 'snippets': {
|
\ 'abbreviations': {
|
||||||
\ '!': "html:5",
|
|
||||||
\ '!!!': "<!DOCTYPE html>\n",
|
\ '!!!': "<!DOCTYPE html>\n",
|
||||||
\ '!!!4t': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n",
|
\ '!!!4t': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n",
|
||||||
\ '!!!4s': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n",
|
\ '!!!4s': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n",
|
||||||
@@ -1589,67 +1638,30 @@ let s:emmet_settings = {
|
|||||||
\ 'cc:ie6': "<!--[if lte IE 6]>\n\t${child}|\n<![endif]-->",
|
\ 'cc:ie6': "<!--[if lte IE 6]>\n\t${child}|\n<![endif]-->",
|
||||||
\ 'cc:ie': "<!--[if IE]>\n\t${child}|\n<![endif]-->",
|
\ 'cc:ie': "<!--[if IE]>\n\t${child}|\n<![endif]-->",
|
||||||
\ 'cc:noie': "<!--[if !IE]><!-->\n\t${child}|\n<!--<![endif]-->",
|
\ 'cc:noie': "<!--[if !IE]><!-->\n\t${child}|\n<!--<![endif]-->",
|
||||||
\ 'html:4t': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
|
\ },
|
||||||
\ ."<html lang=\"${lang}\">\n"
|
\ 'snippets': {
|
||||||
\ ."<head>\n"
|
\ '!': "html:5",
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
|
\ 'doc': "html>(head>meta[charset=${charset}]+title{${1:Document}})+body>${child}",
|
||||||
\ ."\t<title></title>\n"
|
\ 'doc4': "html>(head>meta[http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\"]+title{${1:Document}})+body>${child}",
|
||||||
\ ."</head>\n"
|
\ 'html:4t': "!!!4t+doc4[lang=${lang}]",
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
\ 'html:4s': "!!!4s+doc4[lang=${lang}]",
|
||||||
\ ."</html>",
|
\ 'html:xt': "!!!xt+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]",
|
||||||
\ 'html:4s': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
|
\ 'html:xs': "!!!xs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]",
|
||||||
\ ."<html lang=\"${lang}\">\n"
|
\ 'html:xxs': "!!!xxs+doc4[xmlns=http://www.w3.org/1999/xhtml xml:lang=${lang}]",
|
||||||
\ ."<head>\n"
|
\ 'html:5': "!!!+doc[lang=${lang}]",
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ 'html:xt': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
|
|
||||||
\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
|
|
||||||
\ ."<head>\n"
|
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ 'html:xs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
|
|
||||||
\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
|
|
||||||
\ ."<head>\n"
|
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ 'html:xxs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
|
|
||||||
\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
|
|
||||||
\ ."<head>\n"
|
|
||||||
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ 'html:5': "<!DOCTYPE html>\n"
|
|
||||||
\ ."<html lang=\"${lang}\">\n"
|
|
||||||
\ ."<head>\n"
|
|
||||||
\ ."\t<meta charset=\"${charset}\">\n"
|
|
||||||
\ ."\t<title></title>\n"
|
|
||||||
\ ."</head>\n"
|
|
||||||
\ ."<body>\n\t${child}|\n</body>\n"
|
|
||||||
\ ."</html>",
|
|
||||||
\ },
|
\ },
|
||||||
\ 'default_attributes': {
|
\ 'default_attributes': {
|
||||||
\ 'a': {'href': ''},
|
\ 'a': [{'href': ''}],
|
||||||
\ 'a:link': {'href': 'http://|'},
|
\ 'a:link': [{'href': 'http://|'}],
|
||||||
\ 'a:mail': {'href': 'mailto:|'},
|
\ 'a:mail': [{'href': 'mailto:|'}],
|
||||||
\ 'abbr': {'title': ''},
|
\ 'abbr': [{'title': ''}],
|
||||||
\ 'acronym': {'title': ''},
|
\ 'acronym': [{'title': ''}],
|
||||||
\ 'base': {'href': ''},
|
\ 'base': [{'href': ''}],
|
||||||
\ 'bdo': {'dir': ''},
|
\ 'bdo': [{'dir': ''}],
|
||||||
\ '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}'},
|
\ 'ins': [{'datetime': '${datetime}'}],
|
||||||
\ 'link:css': [{'rel': 'stylesheet'}, g:emmet_html5 ? {} : {'type': 'text/css'}, {'href': '|style.css'}, {'media': 'all'}],
|
\ 'link:css': [{'rel': 'stylesheet'}, g:emmet_html5 ? {} : {'type': 'text/css'}, {'href': '|style.css'}, {'media': 'all'}],
|
||||||
\ 'link:print': [{'rel': 'stylesheet'}, g:emmet_html5 ? {} : {'type': 'text/css'}, {'href': '|print.css'}, {'media': 'print'}],
|
\ 'link:print': [{'rel': 'stylesheet'}, g:emmet_html5 ? {} : {'type': 'text/css'}, {'href': '|print.css'}, {'media': 'print'}],
|
||||||
\ 'link:import': [{'rel': 'import'}, {'href': '|.html'}],
|
\ 'link:import': [{'rel': 'import'}, {'href': '|.html'}],
|
||||||
@@ -1662,9 +1674,9 @@ let s:emmet_settings = {
|
|||||||
\ 'meta:vp': [{'name': 'viewport'}, {'content': 'width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'}],
|
\ 'meta:vp': [{'name': 'viewport'}, {'content': 'width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'}],
|
||||||
\ 'meta:win': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=Win-1251'}],
|
\ 'meta:win': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=Win-1251'}],
|
||||||
\ 'meta:compat': [{'http-equiv': 'X-UA-Compatible'}, {'content': 'IE=7'}],
|
\ 'meta:compat': [{'http-equiv': 'X-UA-Compatible'}, {'content': 'IE=7'}],
|
||||||
\ 'style': g:emmet_html5 ? {} : {'type': 'text/css'},
|
\ 'style': g:emmet_html5 ? [] : [{'type': 'text/css'}],
|
||||||
\ 'script': g:emmet_html5 ? {} : {'type': 'text/javascript'},
|
\ 'script': [{'src': ''}] + (g:emmet_html5 ? [] : [{'type': 'text/javascript'}]),
|
||||||
\ 'script:src': g:emmet_html5 ? {'src': ''} : [{'type': 'text/javascript'}, {'src': ''}],
|
\ 'script:src': [{'src': ''}] + (g:emmet_html5 ? [] : [{'type': 'text/javascript'}, {'src': ''}]),
|
||||||
\ 'img': [{'src': ''}, {'alt': ''}],
|
\ 'img': [{'src': ''}, {'alt': ''}],
|
||||||
\ 'iframe': [{'src': ''}, {'frameborder': '0'}],
|
\ 'iframe': [{'src': ''}, {'frameborder': '0'}],
|
||||||
\ 'embed': [{'src': ''}, {'type': ''}],
|
\ 'embed': [{'src': ''}, {'type': ''}],
|
||||||
@@ -1677,12 +1689,12 @@ let s:emmet_settings = {
|
|||||||
\ 'area:r': [{'shape': 'rect'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
|
\ 'area:r': [{'shape': 'rect'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
|
||||||
\ 'area:p': [{'shape': 'poly'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
|
\ 'area:p': [{'shape': 'poly'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
|
||||||
\ 'link': [{'rel': 'stylesheet'}, {'href': ''}],
|
\ 'link': [{'rel': 'stylesheet'}, {'href': ''}],
|
||||||
\ 'form': {'action': ''},
|
\ 'form': [{'action': ''}],
|
||||||
\ 'form:get': {'action': '', 'method': 'get'},
|
\ 'form:get': [{'action': ''}, {'method': 'get'}],
|
||||||
\ 'form:post': {'action': '', 'method': 'post'},
|
\ 'form:post': [{'action': ''}, {'method': 'post'}],
|
||||||
\ 'form:upload': {'action': '', 'method': 'post', 'enctype': 'multipart/form-data'},
|
\ 'form:upload': [{'action': ''}, {'method': 'post'}, {'enctype': 'multipart/form-data'}],
|
||||||
\ 'label': {'for': ''},
|
\ 'label': [{'for': ''}],
|
||||||
\ 'input': {'type': ''},
|
\ 'input': [{'type': ''}],
|
||||||
\ 'input:hidden': [{'type': 'hidden'}, {'name': ''}],
|
\ 'input:hidden': [{'type': 'hidden'}, {'name': ''}],
|
||||||
\ 'input:h': [{'type': 'hidden'}, {'name': ''}],
|
\ 'input:h': [{'type': 'hidden'}, {'name': ''}],
|
||||||
\ 'input:text': [{'type': 'text'}, {'name': ''}, {'id': ''}],
|
\ 'input:text': [{'type': 'text'}, {'name': ''}, {'id': ''}],
|
||||||
@@ -1715,14 +1727,14 @@ let s:emmet_settings = {
|
|||||||
\ 'input:button': [{'type': 'button'}, {'value': ''}],
|
\ 'input:button': [{'type': 'button'}, {'value': ''}],
|
||||||
\ 'input:b': [{'type': 'button'}, {'value': ''}],
|
\ 'input:b': [{'type': 'button'}, {'value': ''}],
|
||||||
\ 'select': [{'name': ''}, {'id': ''}],
|
\ 'select': [{'name': ''}, {'id': ''}],
|
||||||
\ 'option': {'value': ''},
|
\ 'option': [{'value': ''}],
|
||||||
\ 'textarea': [{'name': ''}, {'id': ''}, {'cols': '30'}, {'rows': '10'}],
|
\ 'textarea': [{'name': ''}, {'id': ''}, {'cols': '30'}, {'rows': '10'}],
|
||||||
\ 'menu:context': {'type': 'context'},
|
\ 'menu:context': [{'type': 'context'}],
|
||||||
\ 'menu:c': {'type': 'context'},
|
\ 'menu:c': [{'type': 'context'}],
|
||||||
\ 'menu:toolbar': {'type': 'toolbar'},
|
\ 'menu:toolbar': [{'type': 'toolbar'}],
|
||||||
\ 'menu:t': {'type': 'toolbar'},
|
\ 'menu:t': [{'type': 'toolbar'}],
|
||||||
\ 'video': {'src': ''},
|
\ 'video': [{'src': ''}],
|
||||||
\ 'audio': {'src': ''},
|
\ 'audio': [{'src': ''}],
|
||||||
\ 'html:xml': [{'xmlns': 'http://www.w3.org/1999/xhtml'}, {'xml:lang': '${lang}'}],
|
\ 'html:xml': [{'xmlns': 'http://www.w3.org/1999/xhtml'}, {'xml:lang': '${lang}'}],
|
||||||
\ },
|
\ },
|
||||||
\ 'aliases': {
|
\ 'aliases': {
|
||||||
@@ -1793,6 +1805,10 @@ let s:emmet_settings = {
|
|||||||
\ 'html.django_template': {
|
\ 'html.django_template': {
|
||||||
\ 'extends': 'html',
|
\ 'extends': 'html',
|
||||||
\ },
|
\ },
|
||||||
|
\ 'jade': {
|
||||||
|
\ 'indentation': ' ',
|
||||||
|
\ 'extends': 'html',
|
||||||
|
\ },
|
||||||
\ 'xsl': {
|
\ 'xsl': {
|
||||||
\ 'extends': 'html',
|
\ 'extends': 'html',
|
||||||
\ 'default_attributes': {
|
\ 'default_attributes': {
|
||||||
@@ -1811,6 +1827,47 @@ let s:emmet_settings = {
|
|||||||
\ 'each': {'select': ''},
|
\ 'each': {'select': ''},
|
||||||
\ 'ap': [{'select': ''}, {'mode': ''}]
|
\ 'ap': [{'select': ''}, {'mode': ''}]
|
||||||
\ },
|
\ },
|
||||||
|
\ "abbreviations": {
|
||||||
|
\ 'tm|tmatch': "<xsl:template match=\"\" mode=\"\">",
|
||||||
|
\ 'tn|tname': "<xsl:template name=\"\">",
|
||||||
|
\ 'call': "<xsl:call-template name=\"\"/>",
|
||||||
|
\ 'ap': "<xsl:apply-templates select=\"\" mode=\"\"/>",
|
||||||
|
\ 'api': "<xsl:apply-imports/>",
|
||||||
|
\ 'imp': "<xsl:import href=\"\"/>",
|
||||||
|
\ 'inc': "<xsl:include href=\"\"/>",
|
||||||
|
\ 'ch': "<xsl:choose>",
|
||||||
|
\ 'wh|xsl:when': "<xsl:when test=\"\">",
|
||||||
|
\ 'ot': "<xsl:otherwise>",
|
||||||
|
\ 'if': "<xsl:if test=\"\">",
|
||||||
|
\ 'par': "<xsl:param name=\"\">",
|
||||||
|
\ 'pare': "<xsl:param name=\"\" select=\"\"/>",
|
||||||
|
\ 'var': "<xsl:variable name=\"\">",
|
||||||
|
\ 'vare': "<xsl:variable name=\"\" select=\"\"/>",
|
||||||
|
\ 'wp': "<xsl:with-param name=\"\" select=\"\"/>",
|
||||||
|
\ 'key': "<xsl:key name=\"\" match=\"\" use=\"\"/>",
|
||||||
|
\ 'elem': "<xsl:element name=\"\">",
|
||||||
|
\ 'attr': "<xsl:attribute name=\"\">",
|
||||||
|
\ 'attrs': "<xsl:attribute-set name=\"\">",
|
||||||
|
\ 'cp': "<xsl:copy select=\"\"/>",
|
||||||
|
\ 'co': "<xsl:copy-of select=\"\"/>",
|
||||||
|
\ 'val': "<xsl:value-of select=\"\"/>",
|
||||||
|
\ 'for|each': "<xsl:for-each select=\"\">",
|
||||||
|
\ 'tex': "<xsl:text></xsl:text>",
|
||||||
|
\ 'com': "<xsl:comment>",
|
||||||
|
\ 'msg': "<xsl:message terminate=\"no\">",
|
||||||
|
\ 'fall': "<xsl:fallback>",
|
||||||
|
\ 'num': "<xsl:number value=\"\"/>",
|
||||||
|
\ 'nam': "<namespace-alias stylesheet-prefix=\"\" result-prefix=\"\"/>",
|
||||||
|
\ 'pres': "<xsl:preserve-space elements=\"\"/>",
|
||||||
|
\ 'strip': "<xsl:strip-space elements=\"\"/>",
|
||||||
|
\ 'proc': "<xsl:processing-instruction name=\"\">",
|
||||||
|
\ 'sort': "<xsl:sort select=\"\" order=\"\"/>",
|
||||||
|
\ 'choose+': "xsl:choose>xsl:when+xsl:otherwise",
|
||||||
|
\ 'xsl': "!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\n|}"
|
||||||
|
\ },
|
||||||
|
\ "snippets": {
|
||||||
|
\ "!!!": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||||
|
\ },
|
||||||
\ 'aliases': {
|
\ 'aliases': {
|
||||||
\ 'tmatch': 'xsl:template',
|
\ 'tmatch': 'xsl:template',
|
||||||
\ 'tname': 'xsl:template',
|
\ 'tname': 'xsl:template',
|
||||||
@@ -1841,28 +1898,15 @@ let s:emmet_settings = {
|
|||||||
\ 'haml': {
|
\ 'haml': {
|
||||||
\ 'indentation': ' ',
|
\ 'indentation': ' ',
|
||||||
\ 'extends': 'html',
|
\ 'extends': 'html',
|
||||||
\ 'snippets': {
|
\ 'abbreviations': {
|
||||||
\ 'html:5': "!!! 5\n"
|
\ '!!!': "!!! 5",
|
||||||
\ ."%html{:lang => \"${lang}\"}\n"
|
|
||||||
\ ."\t%head\n"
|
|
||||||
\ ."\t\t%meta{:charset => \"${charset}\"}\n"
|
|
||||||
\ ."\t\t%title\n"
|
|
||||||
\ ."\t%body\n"
|
|
||||||
\ ."\t\t${child}|\n",
|
|
||||||
\ },
|
\ },
|
||||||
\ 'attribute_style': 'hash',
|
\ 'attribute_style': 'hash',
|
||||||
\ },
|
\ },
|
||||||
\ 'slim': {
|
\ 'slim': {
|
||||||
\ 'indentation': ' ',
|
\ 'indentation': ' ',
|
||||||
\ 'extends': 'html',
|
\ 'extends': 'html',
|
||||||
\ 'snippets': {
|
\ 'abbreviations': {
|
||||||
\ 'html:5': "doctype 5\n"
|
|
||||||
\ ."html lang=\"${lang}\"\n"
|
|
||||||
\ ."\thead\n"
|
|
||||||
\ ."\t\tmeta charset=\"${charset}\"\n"
|
|
||||||
\ ."\t\ttitle\n"
|
|
||||||
\ ."\tbody\n"
|
|
||||||
\ ."\t\t${child}|\n",
|
|
||||||
\ },
|
\ },
|
||||||
\ },
|
\ },
|
||||||
\ 'xhtml': {
|
\ 'xhtml': {
|
||||||
@@ -1879,7 +1923,7 @@ let s:emmet_settings = {
|
|||||||
\ ."\t<xsd:element name=\"\" type=\"\"/>\n"
|
\ ."\t<xsd:element name=\"\" type=\"\"/>\n"
|
||||||
\ ."</xsd:schema>\n"
|
\ ."</xsd:schema>\n"
|
||||||
\ }
|
\ }
|
||||||
\ }
|
\ },
|
||||||
\}
|
\}
|
||||||
|
|
||||||
if exists('g:user_emmet_settings')
|
if exists('g:user_emmet_settings')
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ function! emmet#lang#haml#toString(settings, current, type, inline, filters, ite
|
|||||||
let tmp .= ' '
|
let tmp .= ' '
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
let Val = substitute(Val, '\${cursor}', '', '')
|
|
||||||
if attribute_style ==# 'hash'
|
if attribute_style ==# 'hash'
|
||||||
let tmp .= ' :' . attr . ' => "' . Val . '"'
|
let tmp .= ' :' . attr . ' => "' . Val . '"'
|
||||||
elseif attribute_style ==# 'html'
|
elseif attribute_style ==# 'html'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
let s:mx = '\([+>]\|[<^]\+\)\{-}\s*'
|
let s:mx = '\([+>]\|[<^]\+\)\{-}\s*'
|
||||||
\ .'\((*\)\{-}\s*'
|
\ .'\((*\)\{-}\s*'
|
||||||
\ .'\([@#.]\{-}[a-zA-Z_\!][a-zA-Z0-9:_\!\-$]*\|{\%([^$}]\+\|\$#\|\${\w\+}\|\$\+\)*}*[ \t\r\n}]*\|\[[^\]]\+\]\)'
|
\ .'\([@#.]\{-}[a-zA-Z_\!][a-zA-Z0-9:_\!\-$]*\|\${[^}]\+}\|{\%([^%$}]\+\|\$#\|\${\w\+}\|\$\+\)*}*[ \t\r\n}]*\|\[[^\]]\+\]\)'
|
||||||
\ .'\('
|
\ .'\('
|
||||||
\ .'\%('
|
\ .'\%('
|
||||||
\ .'\%(#{[{}a-zA-Z0-9_\-\$]\+\|#[a-zA-Z0-9_\-\$]\+\)'
|
\ .'\%(#{[{}a-zA-Z0-9_\-\$]\+\|#[a-zA-Z0-9_\-\$]\+\)'
|
||||||
@@ -22,6 +22,13 @@ function! emmet#lang#html#findTokens(str) abort
|
|||||||
endif
|
endif
|
||||||
let pos = stridx(str, tag, pos) + len(tag)
|
let pos = stridx(str, tag, pos) + len(tag)
|
||||||
endwhile
|
endwhile
|
||||||
|
while 1
|
||||||
|
let tag = matchstr(str, '{%[^%]\{-}%}', pos)
|
||||||
|
if len(tag) == 0
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
let pos = stridx(str, tag, pos) + len(tag)
|
||||||
|
endwhile
|
||||||
let last_pos = pos
|
let last_pos = pos
|
||||||
while len(str) > 0
|
while len(str) > 0
|
||||||
let token = matchstr(str, s:mx, pos)
|
let token = matchstr(str, s:mx, pos)
|
||||||
@@ -116,25 +123,54 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
|
|||||||
|
|
||||||
let use_pipe_for_cursor = emmet#getResource(type, 'use_pipe_for_cursor', 1)
|
let use_pipe_for_cursor = emmet#getResource(type, 'use_pipe_for_cursor', 1)
|
||||||
|
|
||||||
" snippets
|
let abbreviations = emmet#getResource(type, 'abbreviations', {})
|
||||||
let snippets = emmet#getResource(type, 'snippets', {})
|
if !empty(abbreviations)
|
||||||
if !empty(snippets)
|
let abbreviation_name = tag_name
|
||||||
let snippet_name = tag_name
|
if has_key(abbreviations, abbreviation_name)
|
||||||
if has_key(snippets, snippet_name)
|
let abbreviation = abbreviation_name
|
||||||
let snippet = snippet_name
|
while has_key(abbreviations, abbreviation)
|
||||||
while has_key(snippets, snippet)
|
let abbreviation = abbreviations[abbreviation]
|
||||||
let snippet = snippets[snippet]
|
|
||||||
endwhile
|
endwhile
|
||||||
if use_pipe_for_cursor
|
if use_pipe_for_cursor
|
||||||
let snippet = substitute(snippet, '|', '${cursor}', 'g')
|
let abbreviation = substitute(abbreviation, '|', '${cursor}', 'g')
|
||||||
endif
|
endif
|
||||||
let lines = split(snippet, "\n", 1)
|
let lines = split(abbreviation, "\n", 1)
|
||||||
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")')
|
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")')
|
||||||
let current.snippet = join(lines, "\n")
|
let current.snippet = join(lines, "\n")
|
||||||
let current.name = ''
|
let current.name = ''
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" snippets
|
||||||
|
let snippets = emmet#getResource(type, 'snippets', {})
|
||||||
|
if empty(current.snippet)
|
||||||
|
let snippets = emmet#getResource(type, 'snippets', {})
|
||||||
|
if !empty(snippets)
|
||||||
|
let snippet_name = tag_name
|
||||||
|
if has_key(snippets, snippet_name)
|
||||||
|
let snippet = snippet_name
|
||||||
|
while has_key(snippets, snippet)
|
||||||
|
let snippet = snippets[snippet]
|
||||||
|
endwhile
|
||||||
|
if use_pipe_for_cursor
|
||||||
|
let snippet = substitute(snippet, '|', '${cursor}', 'g')
|
||||||
|
endif
|
||||||
|
if emmet#isExtends(type, 'html') && snippet !~ '^\s*[{\[<]'
|
||||||
|
let current = emmet#lang#html#parseIntoTree(snippet, a:type)
|
||||||
|
if current.name == '' && current.value == '' && current.snippet == '' && len(current.child) > 0
|
||||||
|
let parent.child += current.child[:-2]
|
||||||
|
let current = current.child[-1]
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let lines = split(snippet, "\n", 1)
|
||||||
|
call map(lines, 'substitute(v:val, "\\( \\|\\t\\)", escape(indent, "\\\\"), "g")')
|
||||||
|
let current.snippet = join(lines, "\n")
|
||||||
|
let current.name = ''
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
let custom_expands = emmet#getResource(type, 'custom_expands', {})
|
let custom_expands = emmet#getResource(type, 'custom_expands', {})
|
||||||
if empty(custom_expands) && has_key(settings, 'custom_expands')
|
if empty(custom_expands) && has_key(settings, 'custom_expands')
|
||||||
let custom_expands = settings['custom_expands']
|
let custom_expands = settings['custom_expands']
|
||||||
@@ -207,7 +243,7 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
|
|||||||
let atts = item[1:-2]
|
let atts = item[1:-2]
|
||||||
if matchstr(atts, '^\s*\zs[0-9a-zA-Z-:]\+\(="[^"]*"\|=''[^'']*''\|=[^ ''"]\+\)') ==# ''
|
if matchstr(atts, '^\s*\zs[0-9a-zA-Z-:]\+\(="[^"]*"\|=''[^'']*''\|=[^ ''"]\+\)') ==# ''
|
||||||
let ks = []
|
let ks = []
|
||||||
if has_key(default_attributes, current.name)
|
if has_key(default_attributes, current.name)
|
||||||
let dfa = default_attributes[current.name]
|
let dfa = default_attributes[current.name]
|
||||||
let ks = type(dfa) == 3 ? keys(dfa[0]) : keys(dfa)
|
let ks = type(dfa) == 3 ? keys(dfa[0]) : keys(dfa)
|
||||||
endif
|
endif
|
||||||
@@ -251,6 +287,9 @@ function! emmet#lang#html#parseIntoTree(abbr, type) abort
|
|||||||
if tag_name =~# '^{.*}$'
|
if tag_name =~# '^{.*}$'
|
||||||
let current.name = ''
|
let current.name = ''
|
||||||
let current.value = tag_name
|
let current.value = tag_name
|
||||||
|
elseif tag_name =~# '^\$\?{.*}$'
|
||||||
|
let current.name = ''
|
||||||
|
let current.value = '{' . tag_name . '}'
|
||||||
else
|
else
|
||||||
let current.value = value
|
let current.value = value
|
||||||
endif
|
endif
|
||||||
@@ -442,17 +481,17 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
|
|||||||
if len(Val) > 0
|
if len(Val) > 0
|
||||||
let Val .= ' '
|
let Val .= ' '
|
||||||
endif
|
endif
|
||||||
if _val =~# '^\a_'
|
if _val =~# '^_'
|
||||||
let lead = _val[0]
|
let lead = vals[0]
|
||||||
let Val .= lead . ' ' . _val
|
let Val .= lead . _val
|
||||||
elseif _val =~# '^_'
|
elseif _val =~# '^-'
|
||||||
if len(lead) == 0
|
if len(lead) == 0
|
||||||
let pattr = current.parent.attr
|
let pattr = current.parent.attr
|
||||||
if has_key(pattr, 'class')
|
if has_key(pattr, 'class')
|
||||||
let lead = pattr['class']
|
let lead = split(pattr['class'], '\s\+')[0]
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
let Val .= lead . ' ' . lead . _val
|
let Val .= lead . _val
|
||||||
else
|
else
|
||||||
let Val .= _val
|
let Val .= _val
|
||||||
endif
|
endif
|
||||||
@@ -623,8 +662,8 @@ function! emmet#lang#html#parseTag(tag) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! emmet#lang#html#toggleComment() abort
|
function! emmet#lang#html#toggleComment() abort
|
||||||
let orgpos = emmet#util#getcurpos()
|
let orgpos = getpos('.')
|
||||||
let curpos = emmet#util#getcurpos()
|
let curpos = getpos('.')
|
||||||
let mx = '<\%#[^>]*>'
|
let mx = '<\%#[^>]*>'
|
||||||
while 1
|
while 1
|
||||||
let block = emmet#util#searchRegion('<!--', '-->')
|
let block = emmet#util#searchRegion('<!--', '-->')
|
||||||
@@ -642,7 +681,7 @@ function! emmet#lang#html#toggleComment() abort
|
|||||||
if pos1[0] == 0 && pos1[1] == 0
|
if pos1[0] == 0 && pos1[1] == 0
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let curpos = emmet#util#getcurpos()
|
let curpos = getpos('.')
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
let pos1 = block[0]
|
let pos1 = block[0]
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ function! emmet#lang#jade#toString(settings, current, type, inline, filters, ite
|
|||||||
let tmp .= ' '
|
let tmp .= ' '
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
let Val = substitute(Val, '\${cursor}', '', '')
|
|
||||||
if attribute_style ==# 'hash'
|
if attribute_style ==# 'hash'
|
||||||
let tmp .= '' . attr . '="' . Val . '"'
|
let tmp .= '' . attr . '="' . Val . '"'
|
||||||
elseif attribute_style ==# 'html'
|
elseif attribute_style ==# 'html'
|
||||||
|
|||||||
@@ -17,20 +17,22 @@ Introduction |emmet-introduction|
|
|||||||
Install |emmet-install|
|
Install |emmet-install|
|
||||||
Tutorial |emmet-tutorial|
|
Tutorial |emmet-tutorial|
|
||||||
1. Expand abbreviation |emmet-expand-abbr| |<C-y>,|
|
1. Expand abbreviation |emmet-expand-abbr| |<C-y>,|
|
||||||
2. Wrap with abbreviation |emmet-wrap-with-abbreviation| |v_<C-y>,|
|
2. Expand word |emmet-expand-word| |<C-y>;|
|
||||||
3. Balance tag inward |emmet-balance-tag-inward| |<C-y>d|
|
3. Update tag |emmet-update-tag| |<C-y>u|
|
||||||
4. Balance tag outward |emmet-balance-tag-outward| |<C-y>D|
|
4. Wrap with abbreviation |emmet-wrap-with-abbreviation| |v_<C-y>,|
|
||||||
5. Go to next edit point |emmet-goto-next-point| |<C-y>n|
|
5. Balance tag inward |emmet-balance-tag-inward| |<C-y>d|
|
||||||
6. Go to previous edit point |emmet-goto-previous-point| |<C-y>N|
|
6. Balance tag outward |emmet-balance-tag-outward| |<C-y>D|
|
||||||
7. Add and update <img> size |emmet-update-image-size| |<C-y>i|
|
7. Go to next edit point |emmet-goto-next-point| |<C-y>n|
|
||||||
8. Merge lines |emmet-merge-lines| |<C-y>m|
|
8. Go to previous edit point |emmet-goto-previous-point| |<C-y>N|
|
||||||
9. Remove tag |emmet-remove-tag| |<C-y>k|
|
9. Add and update <img> size |emmet-update-image-size| |<C-y>i|
|
||||||
10. Split/join tag |emmet-split-join-tag| |<C-y>j|
|
10. Merge lines |emmet-merge-lines| |<C-y>m|
|
||||||
11. Toggle comment |emmet-toggle-comment| |<C-y>/|
|
11. Remove tag |emmet-remove-tag| |<C-y>k|
|
||||||
12. Make anchor from URL |emmet-make-anchor-url| |<C-y>a|
|
12. Split/join tag |emmet-split-join-tag| |<C-y>j|
|
||||||
13. Make quoted text from URL |emmet-quoted-text-url| |<C-y>A|
|
13. Toggle comment |emmet-toggle-comment| |<C-y>/|
|
||||||
14. Code pretty |emmet-code-pretty| |<C-y>c|
|
14. Make anchor from URL |emmet-make-anchor-url| |<C-y>a|
|
||||||
15. Lorem ipsum |emmet-lorem-ipsum|
|
15. Make quoted text from URL |emmet-quoted-text-url| |<C-y>A|
|
||||||
|
16. Code pretty |emmet-code-pretty| |<C-y>c|
|
||||||
|
17. Lorem ipsum |emmet-lorem-ipsum|
|
||||||
HTML expression syntax |emmet-html-expression-syntax|
|
HTML expression syntax |emmet-html-expression-syntax|
|
||||||
1. Elements |emmet-html-syntax-elements|
|
1. Elements |emmet-html-syntax-elements|
|
||||||
2. Nesting operators |emmet-html-syntax-nesting-operators|
|
2. Nesting operators |emmet-html-syntax-nesting-operators|
|
||||||
@@ -146,7 +148,33 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<
|
<
|
||||||
2. Wrap with abbreviation *emmet-wrap-with-abbreviation* *v_<C-y>,*
|
2. Expand abbreviation *emmet-expand-word* *<C-y>;*
|
||||||
|
|
||||||
|
When you want to expand word except html tokens like below, use this.
|
||||||
|
>
|
||||||
|
<html
|
||||||
|
>foo
|
||||||
|
<
|
||||||
|
This will be expanded like:
|
||||||
|
>
|
||||||
|
<html
|
||||||
|
><foo></foo>
|
||||||
|
|
||||||
|
3. Update tag *emmet-update-tag* *<C-y>u*
|
||||||
|
|
||||||
|
The begining of tags '<div>' on below
|
||||||
|
>
|
||||||
|
<div>foo</div>
|
||||||
|
<
|
||||||
|
Type '<C-y>u' request 'Enter Abbreviation:'. Then type
|
||||||
|
>
|
||||||
|
.global
|
||||||
|
<
|
||||||
|
This will be expanded like:
|
||||||
|
>
|
||||||
|
<div class=".global">foo</div>
|
||||||
|
<
|
||||||
|
4. Wrap with abbreviation *emmet-wrap-with-abbreviation* *v_<C-y>,*
|
||||||
|
|
||||||
Write as below.
|
Write as below.
|
||||||
>
|
>
|
||||||
@@ -181,7 +209,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
<
|
<
|
||||||
See also: |emmet-filter-t|, |emmet-$#|
|
See also: |emmet-filter-t|, |emmet-$#|
|
||||||
|
|
||||||
3. Balance tag inward *emmet-balance-tag-inward* *<C-y>d*
|
5. Balance tag inward *emmet-balance-tag-inward* *<C-y>d*
|
||||||
|
|
||||||
To select inward of '<ul>' tag, type '<C-y>d' in insert mode.
|
To select inward of '<ul>' tag, type '<C-y>d' in insert mode.
|
||||||
>
|
>
|
||||||
@@ -194,7 +222,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
If cursor is at '*', '<C-y>d' select from begin of '<ul>' to end of '</ul>'.
|
If cursor is at '*', '<C-y>d' select from begin of '<ul>' to end of '</ul>'.
|
||||||
If cursor is at first of '<li>', it select '<li class="list1"></li>'.
|
If cursor is at first of '<li>', it select '<li class="list1"></li>'.
|
||||||
|
|
||||||
4. Balance tag outward *emmet-balance-tag-outward* *<C-y>D*
|
6. Balance tag outward *emmet-balance-tag-outward* *<C-y>D*
|
||||||
|
|
||||||
To select outward of '<ul>' tag type '<C-y>D' in insert mode.
|
To select outward of '<ul>' tag type '<C-y>D' in insert mode.
|
||||||
>
|
>
|
||||||
@@ -208,7 +236,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
to previous letter of '</ul>'.
|
to previous letter of '</ul>'.
|
||||||
If cursor is at first of '<li>', it select '<li class="list1"></li>'.
|
If cursor is at first of '<li>', it select '<li class="list1"></li>'.
|
||||||
|
|
||||||
5. Go to next edit point *emmet-goto-next-point* *<C-y>n*
|
7. Go to next edit point *emmet-goto-next-point* *<C-y>n*
|
||||||
|
|
||||||
To jump next point that need to edit, type '<C-y>n' in insert mode.
|
To jump next point that need to edit, type '<C-y>n' in insert mode.
|
||||||
>
|
>
|
||||||
@@ -220,7 +248,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
And type again '<C-y>n' to move a cursor
|
And type again '<C-y>n' to move a cursor
|
||||||
into inner of '<div>' specified id as 'bar'.
|
into inner of '<div>' specified id as 'bar'.
|
||||||
|
|
||||||
6. Go to previous edit point *emmet-goto-previous-point* *<C-y>N*
|
8. Go to previous edit point *emmet-goto-previous-point* *<C-y>N*
|
||||||
|
|
||||||
To jump previous point that need to edit, type '<C-y>N' in insert mode.
|
To jump previous point that need to edit, type '<C-y>N' in insert mode.
|
||||||
>
|
>
|
||||||
@@ -232,7 +260,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
And type again '<C-y>N' to move a cursor
|
And type again '<C-y>N' to move a cursor
|
||||||
into attribute value of 'foo'.
|
into attribute value of 'foo'.
|
||||||
|
|
||||||
7. Add and update <img> size *emmet-update-image-size* *<C-y>i*
|
9. Add and update <img> size *emmet-update-image-size* *<C-y>i*
|
||||||
|
|
||||||
To add or update 'width' and 'height' attributes of image,
|
To add or update 'width' and 'height' attributes of image,
|
||||||
type '<C-y>i' on '<img>' tag
|
type '<C-y>i' on '<img>' tag
|
||||||
@@ -250,7 +278,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
Image size retrieved using 'identify' (ImageMagick.org) (if available)
|
Image size retrieved using 'identify' (ImageMagick.org) (if available)
|
||||||
or |xxd|.
|
or |xxd|.
|
||||||
|
|
||||||
8. Merge lines *emmet-merge-lines* *<C-y>m*
|
10. Merge lines *emmet-merge-lines* *<C-y>m*
|
||||||
|
|
||||||
To join multi line text like following, type |J|.
|
To join multi line text like following, type |J|.
|
||||||
>
|
>
|
||||||
@@ -267,7 +295,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
<li class="list1"></li><li class="list2"></li><li class="list3"></li>
|
<li class="list1"></li><li class="list2"></li><li class="list3"></li>
|
||||||
</ul>
|
</ul>
|
||||||
<
|
<
|
||||||
9. Remove tag *emmet-remove-tag* *<C-y>k*
|
11. Remove tag *emmet-remove-tag* *<C-y>k*
|
||||||
|
|
||||||
To remove tag in the block, type '<C-y>k'.
|
To remove tag in the block, type '<C-y>k'.
|
||||||
>
|
>
|
||||||
@@ -283,7 +311,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
<
|
<
|
||||||
And type '<C-y>k' in there again, then '<div>' will be removed.
|
And type '<C-y>k' in there again, then '<div>' will be removed.
|
||||||
|
|
||||||
10. Split/join tag *emmet-split-join-tag* *<C-y>j*
|
12. Split/join tag *emmet-split-join-tag* *<C-y>j*
|
||||||
|
|
||||||
To join block, type '<C-y>j'.
|
To join block, type '<C-y>j'.
|
||||||
>
|
>
|
||||||
@@ -300,7 +328,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
<div class="foo">
|
<div class="foo">
|
||||||
</div>
|
</div>
|
||||||
<
|
<
|
||||||
11. Toggle comment *emmet-toggle-comment* *<C-y>/*
|
13. Toggle comment *emmet-toggle-comment* *<C-y>/*
|
||||||
|
|
||||||
Move cursor to block
|
Move cursor to block
|
||||||
>
|
>
|
||||||
@@ -320,7 +348,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
hello world
|
hello world
|
||||||
</div>
|
</div>
|
||||||
<
|
<
|
||||||
12. Make anchor from URL *emmet-make-anchor-url* *<C-y>a*
|
14. Make anchor from URL *emmet-make-anchor-url* *<C-y>a*
|
||||||
|
|
||||||
Move cursor to URL
|
Move cursor to URL
|
||||||
>
|
>
|
||||||
@@ -332,7 +360,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
<
|
<
|
||||||
Text retrieved using command, specified by |g:emmet_curl_command|.
|
Text retrieved using command, specified by |g:emmet_curl_command|.
|
||||||
|
|
||||||
13. Make quoted text from URL *emmet-quoted-text-url* *<C-y>A*
|
15. Make quoted text from URL *emmet-quoted-text-url* *<C-y>A*
|
||||||
|
|
||||||
Move cursor to URL
|
Move cursor to URL
|
||||||
>
|
>
|
||||||
@@ -348,7 +376,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
<
|
<
|
||||||
Text retrieved using command, specified by |g:emmet_curl_command|.
|
Text retrieved using command, specified by |g:emmet_curl_command|.
|
||||||
|
|
||||||
14. Code pretty *emmet-code-pretty* *<C-y>c*
|
16. Code pretty *emmet-code-pretty* *<C-y>c*
|
||||||
|
|
||||||
Select code block, for example select following code from 'int main()'.
|
Select code block, for example select following code from 'int main()'.
|
||||||
>
|
>
|
||||||
@@ -366,7 +394,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
<
|
<
|
||||||
To convert text into html used command |:TOhtml|.
|
To convert text into html used command |:TOhtml|.
|
||||||
|
|
||||||
15. Lorem ipsum *emmet-lorem-ipsum*
|
17. Lorem ipsum *emmet-lorem-ipsum*
|
||||||
|
|
||||||
To insert dummy text (30 words by default).
|
To insert dummy text (30 words by default).
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ finish
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'query': "html:xt>div#header>div#logo+ul#nav>li.item-$*5>a",
|
'query': "html:xt>div#header>div#logo+ul#nav>li.item-$*5>a",
|
||||||
'result': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />\n\t<title></title>\n</head>\n<body>\n\t<div id=\"header\">\n\t\t<div id=\"logo\"></div>\n\t\t<ul id=\"nav\">\n\t\t\t<li class=\"item-1\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-2\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-3\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-4\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-5\"><a href=\"\"></a></li>\n\t\t</ul>\n\t</div>\n\t\n</body>\n</html>",
|
'result': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n\t<head>\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n\t\t<title>${1:Document}</title>\n\t</head>\n\t<body>\n\t<div id=\"header\">\n\t\t<div id=\"logo\"></div>\n\t\t<ul id=\"nav\">\n\t\t\t<li class=\"item-1\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-2\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-3\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-4\"><a href=\"\"></a></li>\n\t\t\t<li class=\"item-5\"><a href=\"\"></a></li>\n\t\t</ul>\n\t</div>\n\t\n</body>\n</html>",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'query': "ol>li*2",
|
'query': "ol>li*2",
|
||||||
@@ -535,6 +535,10 @@ finish
|
|||||||
'query': "<small>a$$$$</small>",
|
'query': "<small>a$$$$</small>",
|
||||||
'result': "<small><a href=\"\"></a></small>",
|
'result': "<small><a href=\"\"></a></small>",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'query': "form.search-form._wide>input.-query-string+input:s.-btn_large|bem",
|
||||||
|
'result': "<form class=\"search-form search-form_wide\" action=\"\">\n\t<input class=\"search-form-query-string\" type=\"\">\n\t<input class=\"search-form-btn_large\" type=\"submit\" value=\"\">\n</form>\n",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user