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

41,586

Solution 1

Automatic wrap example aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa‌aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa :

This expression has automatic wrap, because I did not press return.

As I understand you want Soft Wraps, when long line is wrapped on screen into multiple lines, but still remains as single line in file.

Soft Wraps

on per file basis
View | Active Editor | Use Soft Wraps

for all files by default
Settings/Preferences | Editor | General | Use soft wraps in editor

Right margin setting

There is also Settings/Preferences | Editor | Code Style | General --> Wrap when typing reaches right margin

But that's different (it will make actual new line).

UPDATE: In current builds IDE can use separate value for right margin per different "language" -- as long as that language has an entry in Code Style settings.


Also keep in mind that any settings from .editorconfig files (if you have such files in your project and EditorConfig plugin is installed & enabled) will override the same from Code Style settings -- it's the nature of the plugin and not a bug (it meant to work this way).

Using EditorConfig support you can configure certain settings that otherwise may not be possible to do via Code Style (e.g. settings for languages/file types that have no separate Code Style entry).

Solution 2

  1. Open Settings
  2. Type "Use Soft Wraps" in search box
  3. In keymap tab right click on "Use Soft Wraps" and add a custom shortcut

You will be able to toggle them with that shortcut

Solution 3

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

Solution 4

For wrapping text/code line by deafault: File -> Settings -> Editor -> General -> section "Soft Wraps" -> checkbox "Use soft wraps in editor"

Solution 5

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)

Share:
41,586
Admin
Author by

Admin

Updated on February 04, 2021

Comments

  • Admin
    Admin about 3 years

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