---
title: "vim中html格式化问题（备忘）"
author: "iyuan"
date: "2013-04-10T18:50:56Z"
tags: ["HTML", "vim", "格式化"]
categories: ["开源软件"]
slug: "vim-html"
draft: false
lastmod: "2013-04-10T18:50:56Z"
id: 1845329
url: "https://iyuan.iteye.com/blog/1845329"
---

拿到一个html文件，全堆在寥寥数行中，格式化之：


```vim

:s/<[^>]*>/\r&\r/g
:g/^$/d
=

```


详情见这里：<http://stackoverflow.com/questions/9987743/format-and-indent-html-in-vim>