Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ide

phpstorm

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

like image 851
Benoit Avatar asked Jul 08 '11 09:07

Benoit


2 Answers

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).

like image 192
LazyOne Avatar answered Oct 23 '22 15:10

LazyOne


  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

like image 9
Serdar D. Avatar answered Oct 23 '22 15:10

Serdar D.