Vim:如何在 php 文件中正确缩进 html 代码?

Jic*_*hao 1 html vim php

在 php 文件中:

<?php
...
?>
<html>

</html>
Run Code Online (Sandbox Code Playgroud)

我无法使用 operator 缩进 html 源代码=

我怎么能缩进呢?

Ben*_*ier 5

我对此的解决方法是暂时切换到 html 模式,标记区域和缩进,然后返回到 php 模式。

:set filetype=html
" mark html code
=
:set filetype=php
Run Code Online (Sandbox Code Playgroud)