Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Soft wraps in intellij

I have enabled all the soft wrap settings that could be found in Intellij (2017.3):

enter image description here

The Appearance|General agrees with that list:

enter image description here I had hit "apply" - which typically actually does work for immediately viewing the effects - and also OK on the Settings dialog.. but to no avail / no difference / still no wrapping. I have tried several times.

This is a bit challenging with very long code lines. Thoughts?

like image 731
WestCoastProjects Avatar asked Apr 18 '18 03:04

WestCoastProjects


People also ask

What is soft wrap?

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

How do I turn off word wrap in IntelliJ?

Right-click the left gutter and from the context menu, either select or clear the Soft-Wrap Current Editor option.

How can I beautify code in IntelliJ?

Go to Settings/Preferences | Editor | Code Style, select your programming language, and open the Wrapping and Braces tab. In the Keep when reformatting section, select the formatting rules which you want to ignore and deselect those which should be applied. Reformat your code ( Ctrl+Alt+L ).


1 Answers

You've picked the right option (File | Settings | Editor | General | Use soft wraps in editor).

[Edit: As of IntelliJ v. 2019.1.3, possibly earlier, the options are now: (File | Settings | Editor | General | Soft-wrap files), with a list of filename extensions that should be soft-wrapped by default.

enter image description here ]

As it said in documentation:

If this checkbox is selected, soft wraps (or word wraps) are used in the editor. The horizontal scroll bar is not normally shown when this option is enabled. However, in certain cases, when a line cannot be "soft-wrapped", the horizontal scroll bar still appears (for example, if a line consists of a single string that is wider than the visible area.)

With the exception described above, when the parameter applied it will wrap the lines in editor

  • if they cannot fit on the editor view,
  • or if their length bigger than value specified by the Right margin (columns) parameter.

In editor the margin displayed as a vertical gray line. It can be specified as File | Settings | Editor | Code Style | Right margin (columns).

like image 59
Pavel Avatar answered Sep 23 '22 03:09

Pavel