Using Zencoding/emmet in Vim

Source: Internet
Author: User

Zencoding's plugin on vim has been renamed to Emmet.vim

1. Installation, recommended to use Vundle plug-in Manager installation, in ~/.VIMRC, add: Bundle ' emmet.vim ', input command vim +bundleinstall +qall to complete the installation;

? ? Personal VIM configuration: Https://www.github.com/lozybean/myVimConfig.git

2. Commonly used abbreviations:

? ? # add an id attribute;

? ? . Add a class attribute;

? ? > Add a subordinate tag;

? ? + Add a parallel label;

? ? [] Add attribute specific value;

? ? {} Add the content displayed in the tag;

? ? * add consecutive same tags;

? ? $ adds an incremented number, $$ represents two digits, etc.;

? ? () is used to change the priority order, the default abbreviation combination priority is? +? is higher than?>, through () The action is like arithmetic change the priority level.

3. An example of the abbreviated combination of PHP p313:

Form[method=post][action=viewthread.php][target=_blank]>h2[align=center]{published an article demonstrating}+ (div[style= "width:200; Float:left "]>h5{option}+ (ul[style=" list-style:none;margin:0px;padding:0px "]>li*9>input[type=checkbox][ Name= "parse[]"][value=$$]) +div[style= "Width:300;float:left"]> (h5{title}>input[type=text][name=subject][ SIZE=50] + (h5{content}>textarea[rows=7][cols=50][name=message]) +input[type=submit][name=replysubmit][value= "Post "]

Because the property is more, write it will be longer, but the use of a lot of acronyms, the cursor to the last (still in the insert mode), press Control+y, and then press, press the key to expand the abbreviation:

4. Multi-line selection: Vim in the selection of multiple lines and then expand, you will be prompted to enter the abbreviation, and then expand the selected lines, if you use * (if the abbreviation is more complex, including attributes, etc. will be * put to the last), then the content of each row is placed in the label, otherwise the entire content into a label.

? ? Multi-line selection appears to be invalid for the input tag, or the single label is invalid for verification.

5. Commonly used editing commands, with the <c-y> expression control+y, the command implementation mode is <C-Y>, and then press a button to achieve:

? ? <c-y> +,: Expand Acronyms

? ? <c-y> + N: Move the cursor to the next edit point

? ? <c-y> + N: Move cursor to previous edit point

? ? <c-y> + D: Select the entire label (visual mode)

? ? <c-y> + D: Check the contents of the tag? (Visual mode)

? ? <c-y> +/: Comment on a label

? ? <c-y> + K: Remove a Label

Using Zencoding/emmet in Vim

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.