衫裤跑路 2012-01-12 17:49 采纳率: 50%
浏览 313
已采纳

我如何重新格式化 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

  • 写回答

13条回答 默认 最新

  • MAO-EYE 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.

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

报告相同问题?

悬赏问题

  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?