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?
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?
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 may also want to consider the Wrap to Column plugin, which implements the equivalent to Alt + Q in Emacs and gq in Vim. This may be preferable to having very long lines that are wrapped by the editor.
This plugin can be installed from any IntelliJ IDEA-based IDE by searching for Wrap to Column.
It has the additional benefit that you can choose to wrap only sections of text that you want :-)
I want to soft-wrap .php files. Putting that in the allowed list still was not working. (For a screenshot, see Mohammed Zayan's answer.)
I entered *.*
there, allowing all the files (I am fine with that) and soft wrap worked fine.