mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 11:14:26 +08:00
Merge pull request #122 from shlomif/master
Remove trailing space + Grammar Corrections.
This commit is contained in:
30
README.mkd
30
README.mkd
@@ -1,6 +1,8 @@
|
|||||||
# ZenCoding-vim
|
# ZenCoding-vim
|
||||||
|
|
||||||
[zencoding-vim](http://mattn.github.com/zencoding-vim) is vim script support for expanding abbreviation like zen-coding(emmet).
|
[zencoding-vim](http://mattn.github.com/zencoding-vim) is a vim plug-in
|
||||||
|
which provides support for expanding abbreviations similar to
|
||||||
|
[zen-coding](http://code.google.com/p/zen-coding/).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -9,14 +11,14 @@
|
|||||||
cd ~/.vim
|
cd ~/.vim
|
||||||
unzip zencoding-vim.zip
|
unzip zencoding-vim.zip
|
||||||
|
|
||||||
If you install pathogen.vim:
|
To install using pathogen.vim:
|
||||||
|
|
||||||
cd ~/.vim/bundle # or make directory
|
cd ~/.vim/bundle
|
||||||
unzip /path/to/zencoding-vim.zip
|
unzip /path/to/zencoding-vim.zip
|
||||||
|
|
||||||
If you get source from repository:
|
To checkout the source from repository:
|
||||||
|
|
||||||
cd ~/.vim/bundle # or make directory
|
cd ~/.vim/bundle
|
||||||
git clone http://github.com/mattn/zencoding-vim.git
|
git clone http://github.com/mattn/zencoding-vim.git
|
||||||
|
|
||||||
or:
|
or:
|
||||||
@@ -30,15 +32,15 @@ or:
|
|||||||
|
|
||||||
## Quick Tutorial
|
## Quick Tutorial
|
||||||
|
|
||||||
Open or create New File:
|
Open or create a New File:
|
||||||
|
|
||||||
vim index.html
|
vim index.html
|
||||||
|
|
||||||
Type ("_" is the cursor position):
|
Type ("\_" is the cursor position):
|
||||||
|
|
||||||
html:5_
|
html:5_
|
||||||
|
|
||||||
Then type "<c-y>," (Ctrl + y + ','), you should see:
|
Then type "\<c-y\>," (Ctrl + y + ','), you should see:
|
||||||
|
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@@ -56,9 +58,9 @@ Then type "<c-y>," (Ctrl + y + ','), you should see:
|
|||||||
|
|
||||||
## Enable in different mode
|
## Enable in different mode
|
||||||
|
|
||||||
If you don't want enable zencoding in all mode,
|
If you don't want to enable zencoding in all modes,
|
||||||
you can use set a option in `vimrc`:
|
you can use set these options in `vimrc`:
|
||||||
|
|
||||||
let g:user_zen_mode='n' "only enable normal mode functions.
|
let g:user_zen_mode='n' "only enable normal mode functions.
|
||||||
let g:user_zen_mode='inv' "enable all functions, which is equal to
|
let g:user_zen_mode='inv' "enable all functions, which is equal to
|
||||||
let g:user_zen_mode='a' "enable all function in all mode.
|
let g:user_zen_mode='a' "enable all function in all mode.
|
||||||
@@ -86,7 +88,7 @@ you can use set a option in `vimrc`:
|
|||||||
> <http://mattn.kaoriya.net/software/vim/20100222103327.htm>
|
> <http://mattn.kaoriya.net/software/vim/20100222103327.htm>
|
||||||
|
|
||||||
> <http://mattn.kaoriya.net/software/vim/20100306021632.htm>
|
> <http://mattn.kaoriya.net/software/vim/20100306021632.htm>
|
||||||
|
|
||||||
### Japanese blog posts about zencoding-vim:
|
### Japanese blog posts about zencoding-vim:
|
||||||
|
|
||||||
> <http://d.hatena.ne.jp/idesaku/20100424/1272092255>
|
> <http://d.hatena.ne.jp/idesaku/20100424/1272092255>
|
||||||
@@ -97,7 +99,7 @@ you can use set a option in `vimrc`:
|
|||||||
|
|
||||||
> <http://looxu.blogspot.jp/2010/02/zencodingvimhtml.html>
|
> <http://looxu.blogspot.jp/2010/02/zencodingvimhtml.html>
|
||||||
|
|
||||||
### tutorial translated in Chinese:
|
### A Chinese translation of the tutorial:
|
||||||
|
|
||||||
> <http://www.zfanw.com/blog/zencoding-vim-tutorial-chinese.html>
|
> <http://www.zfanw.com/blog/zencoding-vim-tutorial-chinese.html>
|
||||||
|
|
||||||
|
|||||||
4
TUTORIAL
4
TUTORIAL
@@ -68,7 +68,7 @@ Tutorial of zencoding.vim
|
|||||||
---------------------
|
---------------------
|
||||||
<img src="foo.png" />
|
<img src="foo.png" />
|
||||||
---------------------
|
---------------------
|
||||||
Type '<c-y>i' on img tag
|
Type '<c-y>i' on img tag
|
||||||
---------------------
|
---------------------
|
||||||
<img src="foo.png" width="32" height="48" />
|
<img src="foo.png" width="32" height="48" />
|
||||||
---------------------
|
---------------------
|
||||||
@@ -101,7 +101,7 @@ Tutorial of zencoding.vim
|
|||||||
Type '<c-y>k' in insert mode.
|
Type '<c-y>k' in insert mode.
|
||||||
---------------------
|
---------------------
|
||||||
<div class="foo">
|
<div class="foo">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ function! zencoding#lang#css#parseIntoTree(abbr, type)
|
|||||||
|
|
||||||
let settings = zencoding#getSettings()
|
let settings = zencoding#getSettings()
|
||||||
let indent = zencoding#getIndentation(type)
|
let indent = zencoding#getIndentation(type)
|
||||||
|
|
||||||
let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'important': 0 }
|
let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'important': 0 }
|
||||||
|
|
||||||
" emmet
|
" emmet
|
||||||
@@ -45,7 +45,7 @@ function! zencoding#lang#css#parseIntoTree(abbr, type)
|
|||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let tag_name = token
|
let tag_name = token
|
||||||
if tag_name =~ '.!$'
|
if tag_name =~ '.!$'
|
||||||
let tag_name = tag_name[:-2]
|
let tag_name = tag_name[:-2]
|
||||||
@@ -56,14 +56,14 @@ function! zencoding#lang#css#parseIntoTree(abbr, type)
|
|||||||
" make default node
|
" make default node
|
||||||
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'important': important }
|
let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0, 'important': important }
|
||||||
let current.name = tag_name
|
let current.name = tag_name
|
||||||
|
|
||||||
" aliases
|
" aliases
|
||||||
let aliases = zencoding#getResource(type, 'aliases', {})
|
let aliases = zencoding#getResource(type, 'aliases', {})
|
||||||
if has_key(aliases, tag_name)
|
if has_key(aliases, tag_name)
|
||||||
let current.name = aliases[tag_name]
|
let current.name = aliases[tag_name]
|
||||||
endif
|
endif
|
||||||
let use_pipe_for_cursor = zencoding#getResource(type, 'use_pipe_for_cursor', 1)
|
let use_pipe_for_cursor = zencoding#getResource(type, 'use_pipe_for_cursor', 1)
|
||||||
|
|
||||||
" snippets
|
" snippets
|
||||||
let snippets = zencoding#getResource(type, 'snippets', {})
|
let snippets = zencoding#getResource(type, 'snippets', {})
|
||||||
if !empty(snippets) && has_key(snippets, tag_name)
|
if !empty(snippets) && has_key(snippets, tag_name)
|
||||||
@@ -83,7 +83,7 @@ function! zencoding#lang#css#parseIntoTree(abbr, type)
|
|||||||
let current.snippet .= "\n"
|
let current.snippet .= "\n"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let current.pos = 0
|
let current.pos = 0
|
||||||
let lg = matchlist(token, '^\%(linear-gradient\|lg\)(\s*\(\w\+\)\s*,\s*\([^,]\+\)\s*,\s*\([^)]\+\)\s*)$')
|
let lg = matchlist(token, '^\%(linear-gradient\|lg\)(\s*\(\w\+\)\s*,\s*\([^,]\+\)\s*,\s*\([^)]\+\)\s*)$')
|
||||||
if len(lg)
|
if len(lg)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
*zencoding.txt* ZenCoding for Vim
|
*zencoding.txt* ZenCoding for Vim
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
ZenCoding: vim plugins for HTML and CSS hi-speed coding
|
ZenCoding: vim plugins for HTML and CSS hi-speed coding
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
|
||||||
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||||
@@ -160,7 +160,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
<div id="bar" class="bar"></li>
|
<div id="bar" class="bar"></li>
|
||||||
<
|
<
|
||||||
If cursor is at '*', |<C-Y>n| move a cursor into attribute value of div
|
If cursor is at '*', |<C-Y>n| move a cursor into attribute value of div
|
||||||
specified id as 'foo'. And type again |<C-Y>n| move a cursor into inner of
|
specified id as 'foo'. And type again |<C-Y>n| move a cursor into inner of
|
||||||
div specified id as 'bar'.
|
div specified id as 'bar'.
|
||||||
|
|
||||||
6. Go to Previous Edit Point *zencoding-goto-previous-point* *<C-Y>N*
|
6. Go to Previous Edit Point *zencoding-goto-previous-point* *<C-Y>N*
|
||||||
@@ -175,11 +175,11 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
|
|
||||||
7. Update <img> Size *zencoding-update-image-size* *<C-Y>i*
|
7. Update <img> Size *zencoding-update-image-size* *<C-Y>i*
|
||||||
|
|
||||||
To expand or update size of image, type |<C-Y>i| on img tag
|
To expand or update size of image, type |<C-Y>i| on img tag
|
||||||
>
|
>
|
||||||
<img src="foo.png" />
|
<img src="foo.png" />
|
||||||
<
|
<
|
||||||
Type '<c-y>i' on img tag
|
Type '<c-y>i' on img tag
|
||||||
>
|
>
|
||||||
<img src="foo.png" width="32" height="32" />
|
<img src="foo.png" width="32" height="32" />
|
||||||
<
|
<
|
||||||
@@ -215,7 +215,7 @@ You should copy this section and create new buffer, paste and write as
|
|||||||
Type |<C-Y>k| in insert mode, then
|
Type |<C-Y>k| in insert mode, then
|
||||||
>
|
>
|
||||||
<div class="foo">
|
<div class="foo">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<
|
<
|
||||||
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.
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ function! s:install_plugin_v()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
if exists('g:user_zen_mode')
|
if exists('g:user_zen_mode')
|
||||||
let imode = matchstr(g:user_zen_mode, '[ai]')
|
let imode = matchstr(g:user_zen_mode, '[ai]')
|
||||||
let nmode = matchstr(g:user_zen_mode, '[an]')
|
let nmode = matchstr(g:user_zen_mode, '[an]')
|
||||||
let vmode = matchstr(g:user_zen_mode, '[av]')
|
let vmode = matchstr(g:user_zen_mode, '[av]')
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ detailed_description: |
|
|||||||
|
|
||||||
There is a movie using zencoding.vim
|
There is a movie using zencoding.vim
|
||||||
ref: http://mattn.github.com/zencoding-vim
|
ref: http://mattn.github.com/zencoding-vim
|
||||||
|
|
||||||
Source Repository.
|
Source Repository.
|
||||||
ref: http://github.com/mattn/zencoding-vim
|
ref: http://github.com/mattn/zencoding-vim
|
||||||
|
|
||||||
Type abbreviation
|
Type abbreviation
|
||||||
+-------------------------------------
|
+-------------------------------------
|
||||||
| html:5_
|
| html:5_
|
||||||
@@ -49,7 +49,7 @@ detailed_description: |
|
|||||||
|</div>
|
|</div>
|
||||||
| _
|
| _
|
||||||
+-------------------------------------
|
+-------------------------------------
|
||||||
|
|
||||||
Tutorial:
|
Tutorial:
|
||||||
|
|
||||||
http://github.com/mattn/zencoding-vim/raw/master/TUTORIAL
|
http://github.com/mattn/zencoding-vim/raw/master/TUTORIAL
|
||||||
@@ -59,10 +59,10 @@ detailed_description: |
|
|||||||
http://mattn.github.com/zencoding-vim
|
http://mattn.github.com/zencoding-vim
|
||||||
|
|
||||||
Tips:
|
Tips:
|
||||||
|
|
||||||
You can customize behavior of expanding with overriding config.
|
You can customize behavior of expanding with overriding config.
|
||||||
This configuration will be merged at loading plugin.
|
This configuration will be merged at loading plugin.
|
||||||
|
|
||||||
let g:user_zen_settings = {
|
let g:user_zen_settings = {
|
||||||
\ 'indentation' : ' ',
|
\ 'indentation' : ' ',
|
||||||
\ 'perl' : {
|
\ 'perl' : {
|
||||||
|
|||||||
Reference in New Issue
Block a user