Can emacs re-indent a big blob of HTML for me?

后端 未结 10 1981
生来不讨喜
生来不讨喜 2021-01-29 20:09

When editing HTML in emacs, is there a way to automatically pretty-format a blob of markup, changing something like this:

  
10条回答
  •  执念已碎
    2021-01-29 20:46

    http://www.delorie.com/gnu/docs/emacs/emacs_277.html

    After selecting the region you want to fix. (To select the whole buffer use C-x h)

    C-M-q

    Reindent all the lines within one parenthetical grouping(indent-sexp).

    C-M-\

    Reindent all lines in the region (indent-region).

提交回复
热议问题