You don't need any plugins to do this.
(您不需要任何插件即可执行此操作。)
Just select all lines ( Ctrl A ) and then from the menu select Edit → Line → Reindent. (只需选择所有行( Ctrl A ),然后从菜单中选择“编辑”→“行”→“重新缩进”。)
This will work if your file is saved with an extension that contains HTML like .html
or .php
. (如果您使用扩展名包含HTML的扩展名(如.html
或.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 (eg 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.
(如果未保存文件(例如,您只是将其粘贴到新窗口中),则可以在选择“重新缩进”选项之前通过选择菜单“视图”→“语法”→ language of choice
的语言”来手动设置缩进的language of choice
。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…