如何在PHPStorm中保留刀片语法的缩进?

如何在PHPStorm中保留刀片语法的缩进?,php,coding-style,phpstorm,blade,Php,Coding Style,Phpstorm,Blade,我正在从*.blade.php文件复制以下代码: @section('content') <h1>All Users</h1> @if ($users->isEmpty()) <h2>No Users Found</h2> @else @foreach ($users as $user) <li>{{ link_to("/users/{$user-&

我正在从*.blade.php文件复制以下代码:

@section('content')
    <h1>All Users</h1>

    @if ($users->isEmpty())
        <h2>No Users Found</h2>
    @else
        @foreach ($users as $user)
            <li>{{ link_to("/users/{$user->username}", $user->username) }}</li>
        @endforeach
    @endif
@stop
@节(“内容”)
所有用户
@如果($users->isEmpty())
找不到用户
@否则
@foreach($users作为$user)
  • {{link_to(“/users/{$user->username},$user->username)}”
  • @endforeach @恩迪夫 @停止
    这是粘贴到同一文件时的显示方式:

    @section('content')
        <h1>All Users</h1>
    
    @if ($users->isEmpty())
            <h2>No Users Found</h2>
    @else
    @foreach ($users as $user)
                <li>{{ link_to("/users/{$user->username}", $user->username) }}</li>
    @endforeach
    @endif
    @stop
    
    @节(“内容”)
    所有用户
    @如果($users->isEmpty())
    找不到用户
    @否则
    @foreach($users作为$user)
    
  • {{link_to(“/users/{$user->username},$user->username)}”
  • @endforeach @恩迪夫 @停止
    我假设某个地方有一种代码样式正在删除blade语法的缩进,但我找不到哪一种。我需要更改什么设置?

    一般来说:

    设置(Mac电脑上的首选项)|编辑器|智能钥匙|粘贴时重新格式化

    为什么是“一般”——因为PhpStorm中还没有合适的刀片支持(但即将推出),因此没有单独的格式化程序规则。因此,上述选项很可能是导致此类行为的原因。

    请参阅和