mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 18:54:27 +08:00
fixed cursor position. fixed ${lang} replacement.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
" File: zencoding.vim
|
||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||
" Last Change: 19-Feb-2010.
|
||||
" Version: 0.3
|
||||
" Version: 0.4
|
||||
" WebPage: http://github.com/mattn/zencoding-vim
|
||||
" Description: vim plugins for HTML and CSS hi-speed coding.
|
||||
" SeeAlso: http://code.google.com/p/zen-coding/
|
||||
@@ -18,7 +18,7 @@
|
||||
" "_" is a cursor position. and type "<c-z>,"
|
||||
" +-------------------------------------
|
||||
" | <!DOCTYPE HTML>
|
||||
" | <html lang="${langfull}">
|
||||
" | <html lang="en">
|
||||
" | <head>
|
||||
" | <title></title>
|
||||
" | <meta charset="UTF-8">
|
||||
@@ -35,14 +35,11 @@
|
||||
" And type "<c-z>,"
|
||||
" +-------------------------------------
|
||||
" |<div id="foo1">
|
||||
" | <div class="bar">
|
||||
" | </div>
|
||||
" | <div class="bar">_</div>
|
||||
" |</div>
|
||||
" |<div id="foo2">
|
||||
" | <div class="bar">
|
||||
" | </div>
|
||||
" | <div class="bar"></div>
|
||||
" |</div>
|
||||
" | _
|
||||
" +-------------------------------------
|
||||
"
|
||||
" Tips:
|
||||
@@ -63,6 +60,8 @@
|
||||
" \ }
|
||||
" \}
|
||||
"
|
||||
" You can set language attribute in html using zen_settings['lang'].
|
||||
"
|
||||
" GetLatestVimScripts: 2981 1 :AutoInstall: zencoding.vim
|
||||
" script type: plugin
|
||||
|
||||
@@ -74,6 +73,7 @@ let g:loaded_zencoding_vim = 1
|
||||
unlet! s:zen_settings
|
||||
let s:zen_settings = {
|
||||
\ 'indentation': "\t",
|
||||
\ 'lang': "en",
|
||||
\ 'css': {
|
||||
\ 'snippets': {
|
||||
\ '@i': '@import url(|);',
|
||||
@@ -594,7 +594,7 @@ let s:zen_settings = {
|
||||
\ ."<body>\n\t${child}|\n</body>\n"
|
||||
\ ."</html>",
|
||||
\ 'html:5': "<!DOCTYPE HTML>\n"
|
||||
\ ."<html lang=\"${langfull}\">\n"
|
||||
\ ."<html lang=\"${lang}\">\n"
|
||||
\ ."<head>\n"
|
||||
\ ." <title></title>\n"
|
||||
\ ." <meta charset=\"UTF-8\">\n"
|
||||
@@ -944,6 +944,7 @@ function! s:zen_expand()
|
||||
if expand !~ '|'
|
||||
let expand .= '|'
|
||||
endif
|
||||
let expand = substitute(expand, '${lang}', s:zen_settings['lang'], 'g')
|
||||
silent! exec "normal! ".repeat("x", len(part))
|
||||
let size = len(line) - len(part)
|
||||
let indent = repeat(s:zen_settings['indentation'], size)
|
||||
@@ -992,7 +993,7 @@ function! s:zen_mergeConfig(lhs, rhs)
|
||||
endfunction
|
||||
|
||||
if exists('g:user_zen_settings')
|
||||
call s:zen_mergeConfig(s:zen_settings, g:user_zen_settings)
|
||||
call s:zen_mergeConfig(s:zen_settings, g:user_zen_settings)
|
||||
endif
|
||||
" test
|
||||
"echo ZenExpand('html:xt>div#header>div#logo+ul#nav>li.item-$*5>a', '')
|
||||
|
||||
@@ -2,7 +2,7 @@ script_name: ZenCoding.vim
|
||||
script_id: '2981'
|
||||
script_type: utility
|
||||
script_package: zencoding.vim
|
||||
script_version: '0.3'
|
||||
script_version: '0.4'
|
||||
required_vim_version: '7.0'
|
||||
summary: vim plugins for HTML and CSS hi-speed coding.
|
||||
|
||||
@@ -18,7 +18,7 @@ detailed_description: |
|
||||
"_" is a cursor position. and type "<c-z>,"
|
||||
+-------------------------------------
|
||||
| <!DOCTYPE HTML>
|
||||
| <html lang="${langfull}">
|
||||
| <html lang="en">
|
||||
| <head>
|
||||
| <title></title>
|
||||
| <meta charset="UTF-8">
|
||||
@@ -35,12 +35,10 @@ detailed_description: |
|
||||
And type "<c-z>,"
|
||||
+-------------------------------------
|
||||
|<div id="foo1">
|
||||
| <div class="bar">
|
||||
| </div>
|
||||
| <div class="bar">_</div>
|
||||
|</div>
|
||||
|<div id="foo2">
|
||||
| <div class="bar">
|
||||
| </div>
|
||||
| <div class="bar"></div>
|
||||
|</div>
|
||||
| _
|
||||
+-------------------------------------
|
||||
@@ -63,10 +61,14 @@ detailed_description: |
|
||||
\ }
|
||||
\}
|
||||
|
||||
You can set language attribute in html using zen_settings['lang'].
|
||||
|
||||
install_details: |
|
||||
copy zencoding.vim to your plugin directory.
|
||||
|
||||
versions:
|
||||
- '0.4': |
|
||||
This is an upgrade for ZenCoding.vim: fixed cursor position. fixed ${lang} replacement.
|
||||
- '0.3': |
|
||||
This is an upgrade for ZenCoding.vim: fixed line expanding.
|
||||
- '0.2': |
|
||||
|
||||
Reference in New Issue
Block a user