Code Wrap IntelliJ?

Sayat Satybald picture Sayat Satybald · Apr 11, 2014 · Viewed 89.4k times · Source

How would be possible to assign a shortcut for word wrap like as sublime text do? i.e. if the code line is too long it should be automatically break to the next line. wikipedia.org.org/Word_wrap

This code should be wrapped out

Answer

Shorn picture Shorn · Apr 15, 2014

I think "soft wrap" might be what you're after. It's read-only, i.e. does not change the characters in the file, it only wraps what you see on screen.

settings soft wrap Intellij >= 14.1.4: As pointed out by looper in the comments, the options are under File > Settings > Editor > General - under the Virtual Space or Soft Wraps sub-group.

Intellij < 14.1.4: Look under File > Settings > Editor > Virtual Space. It doesn't have a shortcut by default, but you can assign one in the keymap.

AndroidStudio >= 1.4.1: the options are under File > Settings > Editor > General - under the Soft Wraps sub-group.

You can also right click the gutter (the vertical bar where line number is shown) and select "Use Soft wraps" - thanks to Bajal for comment. gutter soft wrap