emacs 格式化html 代码

Vim、Emacs配置和使用
回复
gy619
帖子: 237
注册时间: 2011-10-11 10:16

emacs 格式化html 代码

#1

帖子 gy619 » 2012-06-06 17:51

emacs 怎么格式化html代码呢?
我用下面这段
;;格式化整个文件函数
(defun indent-whole ()
(interactive)
(indent-region (point-min) (point-max))
(message "format successfully"))
;;绑定到F7键
(global-set-key [f7] 'indent-whole)
格式化html代码。格式化非常丑,效果如下
<!--main-->
<div class="main">
<div class="col-left">
<div class="news-hot">
<div class="content">

emacs有什么好的方法格式化代码?特别是格式化html代码吗?
gy619
帖子: 237
注册时间: 2011-10-11 10:16

Re: emacs 格式化html 代码

#2

帖子 gy619 » 2012-06-07 16:08

这个html 格式化代码,意外解决了, :em09 和dw格式源码的效果差不多。 又来了一个问题。。。
emacs就是解决一个一个问题的过程。。
头像
reverland
帖子: 1317
注册时间: 2011-11-26 15:57
系统: windows xp
联系:

Re: emacs 格式化html 代码

#3

帖子 reverland » 2012-06-08 12:03

我来翻译下lz的话:用emacs就是折腾……
托在github上的jekyll博客
Always Look on the Bright Side of Life
回复