Php Storm : How can i automate breaking lines in PHPStorm 2.1

Viewed 43127

How can i automate breaking lines (word wrap) in PHPStorm 2.1?

9 Answers

In PhpStorm 2019.1.3 You should add file type you want to make soft wrapping on it

go to Settings -> Editor -> General -> Soft-wrap files then add any types you want

enter image description here

In Webstorm 2020.3 i did not found any option for all files by default, but just change the pattern:

for ALL files:

Settings > Editor > General > Soft Warps > Soft-wrap theses files: you can change value to:

*.* (in the other words "ANY file name" and "ANY extension file")

for SOME FILES:

*.php; *.html (Any files with exntension .php OR .html)

in phpstorm 2016:

Settings/Preferences | Editor | Code Style | General --> default option-> uncheck wrap on typing

To make it automatic

After applying this point:

Use Ctrl + Alt + S to open the settings menu

  1. Select and click Editor

  2. Choose Code Style

  3. Change the default value of the Hard wrap value to 90

  4. Go back to CodeStyle and choose any of the language you work with to make specific changes

5.1 I choose HTML and Select Other and i change the value of Hard wrap at 90 and wrap on typing to Yes

5.2 I choose JavaScript and Select Wrapping and Braces and change the Hard wrap at value to 90 and wrap on typing to Yes

  1. Continue to do it with all other languages you work with

NB: other languages may be at a default values, change it if is not preferable to you

  1. Apply and Ok to save the changes

Using phpstorm 2019.3.4 as well as new and older version :

  1. Use Ctrl + Alt + S to open the settings menu

  2. Select and click Editor

  3. Choose Code Style

  4. Change the default value of the Hard wrap value to 90

  5. Apply and save changes

  6. Press Ctrl + A to highlight and select all your codes in the text editor

  7. Press Ctrl + Alt + L to format your code nicely

Or when using the default settings for Hard wrap at 180 , follow 6 and 7

Related