larry*wei 2012-01-12 17:49 采纳率: 0%
浏览 450
已采纳

我如何重新格式化 HTML 代码使用崇高的文本2?

I've got some poorly-formatted HTML code that I'd like to reformat. Is there a command that will automatically reformat HTML code in Sublime Text 2 so it looks better and is easier to read?

转载于:https://stackoverflow.com/questions/8839753/how-do-i-reformat-html-code-using-sublime-text-2

  • 写回答

15条回答 默认 最新

  • 三生石@ 2012-06-04 21:47
    关注

    You don't need any plugins to do this. Just select all lines (<kbd>Ctrl </kbd><kbd>A</kbd>) and then from the menu select Edit → Line → Reindent. This will work if your file is saved with an extension that contains HTML like .html or .php.

    If you do this often, you may find this key mapping useful:

    { "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } }
    

    If your file is not saved (e.g. you just pasted in a snippet to a new window), you can manually set the language for indentation by selecting the menu View → Syntax → language of choice before selecting the reindent option.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(14条)

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改