Word wrapping in PhpStorm
How can I enable word wrapping in PhpStorm?
I need to enable it only for some of my files (with extension .txt). Is it possible?
Solution 1:
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).
Solution 2:
You have to enable Soft Wraps. Find that option through this path.
Menu View → Active Editor → Use Soft Wraps
Solution 3:
Right click on the line number area and choose:
Soft-Wrap All Files or Soft-Wrap Current File, i.e.:
Solution 4:
-
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).