ZenCoding Vim 插件

9
2010
# 作者: riku / 本文采用CC BY-NC-SA 2.5协议授权,转载请注明本文链接

以前见过一个名为 Zen Coding 的工具,通过它可以快速输入 Html 及 CSS 代码,这里有视频演示

而事实上,ZenCoding 还有 VIM 插件,这样你可以用 VIM 来快速编写 Html 网页了。

插件主页:http://www.vim.org/scripts/script.php?script_id=2981

# 安装:

只要把下载下来的 zencoding.vim 文件放到 ~/.vim/ftplugin/html 或 ~/.vim/pluging 目录下就可以了

# 使用:

  • 样例1:自动展开 html 模版

输入

html:5

然后按快捷键 CTRL+Y 及 , 号就会自动展开 html 模版

<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>

</body>
</html>

  • 样例2:自动插入链接

输入链接:

http://wowubuntu.com/

然后按快捷键 CTRL+Y 及 a 键就会自动生成超链接代码

<a href="http://wowubuntu.com/"> Wow! Ubuntu / Ubuntu 及Linux 新闻、技巧、软件及游戏!</a>

  • 样例3:自动展开 CSS 代码

输入

div>p#foo$*3>a

然后按快捷键 CTRL+Y 及 , 号就会自动展开 CSS 代码

<div>
<p id="foo1">
<a href=""></a>
</p>
<p id="foo2">
<a href=""></a>
</p>
<p id="foo3">
<a href=""></a>
</p>
</div>

神奇吧,详细的使用教程见这里这里

作者:riku

Bio: 关注新网络、Web2.0、移动应用;Nexus S/Andorid,iPad,FreeBSD,Ubuntu 用户;伪设计师,好推墙运动。
链接:Blog - Twitter - Facebook - 此作者的更多文章

7 Responses to ZenCoding Vim 插件

Avatar

神飞

Google Chrome 7.0.517.36 Google Chrome 7.0.517.36 Windows 7 Windows 7

十月 9th, 2010 at 11:24 上午

非常赞,最近开始尝试在ubuntu上code,vim+zencode是个让人振奋的组合...

[Reply]

Avatar

ikbear

Firefox 4.0b6 Firefox 4.0b6 Windows XP Windows XP

十月 9th, 2010 at 12:13 下午

一直无奈于linux下的web开发工具,这个不错。

[Reply]

Avatar

Lain

Firefox 3.6.10 Firefox 3.6.10 Windows Vista Windows Vista

十月 9th, 2010 at 2:37 下午

用ZenCoding写HTML有多爽,用了就知道!

[Reply]

Avatar

yicuan

Google Chrome 7.0.530.0 Google Chrome 7.0.530.0 Windows XP Windows XP

十月 10th, 2010 at 12:43 上午

Emacs 也有類似插件
zencoding for emacs:http://www.emacswiki.org/emacs/ZenCoding
可以在這個地址看一下

[Reply]

Avatar

可乐加糖

Firefox 6.0 Firefox 6.0 GNU/Linux GNU/Linux

九月 19th, 2011 at 9:17 上午

博主您好,请问一下,我貌似没有看见您文章中写的那个路径。我的 VIM 路径如下。

coke@ubuntu:~/下载/vim 插件/NERD_tree/nerdtree_plugin$ whereis vim

vim: /usr/bin/vim.basic
/usr/bin/vim.tiny
/usr/bin/vim
/etc/vim
/usr/share/vim
/usr/share/man/man1/vim.1.gz

[Reply]

Avatar

freetstar

Firefox 6.0.2 Firefox 6.0.2 GNU/Linux x64 GNU/Linux x64

九月 26th, 2011 at 10:18 上午

挺好用的~

[Reply]

Avatar

xwsoul

Firefox 11.0 Firefox 11.0 Ubuntu Ubuntu

四月 20th, 2012 at 9:34 上午

Zencoding ... 不仅仅可以用来代码的展开...
还可以选择父级标签...

[Reply]

Comment Form

top

无觅相关文章插件,快速提升流量