Some common operations of VIM plug-in zencoding

Source: Internet
Author: User
Some common operations of VIM plug-in zencoding

Pretty cool, record some common operations

Easy to install, no longer like I used sparkup. Vim to configure the python environment, can be directly connected to the http://github.com/mattn/zencoding-vim
Download the zencoding. Vim file and place it invimfiles/plugin
Or.vim/plugin
The directory is OK.

Next we will introduce some usage methods (copy from lazyhack and use ZEN coding for VIM to quickly write HTML code
)

  • Expand abbreviation

Inputdiv>p#foo$*3>a
And then pressctrl + y + ,
To expand (note the comma), it should look like this after expansion

 <div>      <p id="foo1">          <a href=""></a>      </p>      <p id="foo2">          <a href=""></a>      </p>      <p id="foo3">          <a href=""></a>      </p>  </div>
  • Abbreviation of multiple lines

Enter the following information:

test1test2test3

Then enter the row selection mode, select the three rows and pressctrl + y + ,
And then it will prompt the tag name you want to use,Tag: Enter 'ul> li *
It will look like the following:

<ul>    <li>test1</li>    <li>test2</li>    <li>test3</li></ul>

For inputblockquote
, It will become like this

  <blockquote>      test1      test2      test3  </blockquote>
  • Jump to the next tag editing location

Inputctrl + y + n
Enter insert mode

  • Jump to the last tag editing position

Inputctrl + y + N
Enter insert mode

  • Update the image size in a tag

If the following content exists:

Move cursorimg
Label, pressctrl + y + i
The plug-in will automatically get the size of foo.png and insert the attribute of width and height.
It looks like this

  • Switch Annotation

See the following section

<div>    hello world</div>

Move the cursor to this section and enterctrl + y + /
Change

<!-- <div>    hello world</div> -->

Input again to restore

  • Generate URL Connection

Move the cursor to a URL, for example:

http://www.google.com/

Inputctrl + y + a
It automatically obtains the title of the URL page and generates a connection.

<a href="http://www.google.com/"></a>

Zencoding. Vim is updated frequently.

Vim official plug-in address: http://www.vim.org/scripts/script.php? Script_id = 1, 2981

Zencoding. Vim address on GitHub: http://github.com/mattn/zencoding-vim

Zen coding official address: http://code.google.com/p/zen-coding/

Quick Reference Manual officially provided by Zen coding (PDF): http://zen-coding.googlecode.com/files/ZenCodingCheatSheet.pdf

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.