How can i automate breaking lines (word wrap) in PHPStorm 2.1?
For wrapping text/code line by deafault: File -> Settings -> Editor -> General -> section "Soft Wraps" -> checkbox "Use soft wraps in editor"
In Webstorm 2020.3 i did not found any option for all files by default, but just change the pattern:
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")
Using phpstorm 2019.3.4 as well as new and older version :
Use Ctrl + Alt + S to open the settings menu
Select and click Editor
Choose Code Style
Change the default value of the Hard wrap value to 90
Apply and save changes
Press Ctrl + A to highlight and select all your codes in the text editor
Press Ctrl + Alt + L to format your code nicely
Or when using the default settings for Hard wrap at 180 , follow 6 and 7
To make it automatic
After applying this point:
Use Ctrl + Alt + S to open the settings menu
Select and click Editor
Choose Code Style
Change the default value of the Hard wrap value to 90
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
NB: other languages may be at a default values, change it if is not preferable to you
You will be able to toggle them with that shortcut
in phpstorm 2016:
Settings/Preferences | Editor | Code Style | General --> default option-> uncheck wrap on typing