You can enable soft wrap for the editor with ⇧⇧ (macOS), or *Shift+Shift (Windows/Linux), for the Search Everywhere dialogue, and then typing in soft wrap. You can also go to Preferences/Settings > Editor > General to enable Soft Wraps for more file types by default.
Enable soft wraps for the file types that tend to have lots of long lines (Preferences/Settings | Editor | General > Soft-wrap files). With the soft wrapping on, the IDE will display those lines wrapped in the editor without adding line breaks.
A soft return or soft wrap is the break resulting from line wrap or word wrap (whether automatic or manual), whereas a hard return or hard wrap is an intentional break, creating a new paragraph. With a hard return, paragraph-break formatting can (and should) be applied (either indenting or vertical whitespace).
You can also enable or disable soft wraps right in the editor: Right-click the left gutter and from the context menu, either select or clear the Soft-Wrap Current Editor option.
For all files (default setting for opened files): Settings/Preferences → Editor → General → Use soft wraps in editor. You can now specify file names/extensions where this option will be enabled by default:
For the currently opened file in the editor: menu → View → Active Editor → Use Soft Wraps (Note: I've assigned custom Ctrl + Alt + R + shortcut for that)
For quite a while (since v2016 or so) you can also access this option via the context menu for the editor gutter area (the area with line numbers on the left side of the editor):
(Note: I have customised this menu quite a bit; by default it has much less items here)
Search Everywhere (Shift 2x times) or menu Help → Find Action... (Ctrl + Shift + A on Windows using the Default keymap) can also be used to quickly change this option (instead of going into Settings/Preferences).
You have to enable Soft Wraps. Find that option through this path.
Menu View → Active Editor → Use Soft Wraps
Right click on the line number area and choose:
Soft-Wrap All Files or Soft-Wrap Current File, i.e.:
Menu File → Settings → Editor → Use soft wraps in editor: to turn them on for all files by default.
Menu File → Settings → Code Style → General → Wrap when typing reaches right margin
.. but that's different (it will make new line).
In addition to Settings -> Editor -> Use soft wraps in editor I recommend Use soft wraps in console and Use custom soft wraps indent with a setting of 4 to make the wraps indented to match the line they started on.
In PhpStorm 2019.1.3, it is possible to enable soft wrap for some file types only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With