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
)
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
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
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