akalongman / sublimetext-codeformatter

Code Formatter plugin for ST2/ST3
MIT License
772 stars 130 forks source link

Disable formatting in html-php files #407

Closed noirwave closed 4 years ago

noirwave commented 4 years ago

I have file like this:

        <div id="sidebar">
            <div class="sidebar-container">
                <div class="sidebar-menu">
                    <?= MenuWidget::widget([
                        'position' => [MenuPositions::TOP, MenuPositions::SIDE],
                    ])?>
                </div>
            </div>
        </div>

after format i have

        <div id="sidebar">
            <div class="sidebar-container">
                <div class="sidebar-menu">
                    <?=MenuWidget::widget([
    'position' => [MenuPositions::TOP, MenuPositions::SIDE],
])?>
                </div>
            </div>
        </div>

How can i disable formatting in this file? Maybe i can sat path mask for files that should not be formatted

noirwave commented 4 years ago

I realised that i can set regex for option format_on_save with exclude path like this

"format_on_save": "^((?!views).)*$",