Manhhailua
Manhhailua

Reputation: 1082

How do I stop wrapping code when reformat code in phpstorm?

If my code reaches the right magin and I reformat code (Ctrl + Alt + L), PHPStorm automatically wrap code. How do I stop this (reformatting code with wrapping)? I'm working with php and other languages for web development

Upvotes: 12

Views: 9335

Answers (3)

yb50110
yb50110

Reputation: 131

I found this worked for me for the auto format wrapping issue: Preferences > Editor > Code Style > HTML
From there, change the Wrap Attributes dropdown select to Do not wrap and I also unchecked the box Wrap Text. See below: enter image description here

Edit: I should add that I have the PhpStorm version 2018.2

Upvotes: 10

mixel
mixel

Reputation: 25876

In newer PhpStorm (and other IntelliJ IDEA based IDEs) versions option is renamed to Wrap on typing and moved to Preferences -> Editor -> Code Style.

PhpStorm screenshot

Upvotes: 1

dalevink
dalevink

Reputation: 294

See under Preferences > Code Style, where you can tweak by language.

Also check the settings under Preferences > Code Style > General (affects all languages):

PhpStorm > Preferences > Code Style > General

Upvotes: 12

Related Questions