Word wrapping in PhpStorm

136,682

Solution 1

For all files (default setting for opened files): Settings/PreferencesEditorGeneralUse soft wraps in editor. You can now specify file names/extensions where this option will be enabled by default:

Enter image description here


For the currently opened file in the editor: menu → ViewActive EditorUse Soft Wraps (Note: I've assigned custom Ctrl + Alt + R + shortcut for that)

Enter image description here

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

Enter image description here

(Note: I have customised this menu quite a bit; by default it has much less items here)


Search Everywhere (Shift 2x times) or menu HelpFind 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).

Enter image description here

Solution 2

You have to enable Soft Wraps. Find that option through this path.

Menu ViewActive EditorUse Soft Wraps

Wrap words in PhpStorm

Solution 3

Right click on the line number area and choose:

Soft-Wrap All Files or Soft-Wrap Current File, i.e.:

Enter image description here

Solution 4

  • Menu FileSettingsEditorUse soft wraps in editor: to turn them on for all files by default.

  • Menu FileSettingsCode StyleGeneralWrap when typing reaches right margin

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

Solution 5

In addition to Settings -> Editor -> Use soft wraps in editor I recommend Use soft wraps in console and Use custom soft wraps indent with a setting of 4 to make the wraps indented to match the line they started on.

Share:
136,682

Related videos on Youtube

ozahorulia
Author by

ozahorulia

PHP Developer LinkedIn Facebook

Updated on May 29, 2021

Comments

  • ozahorulia
    ozahorulia almost 3 years

    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?

    • Maccath
      Maccath over 11 years
      It's a shame that you can't specifically set it to soft wrap for certain file types. I only ever want to wrap if it's a HTML file, and it would be so much handier if I could set it to do that automatically instead of having to click through the menu each time.
    • reformed
      reformed about 4 years
      @Maccath it appears you can do that now. See the "soft-wrap files" setting in PHPStorm.
  • azzy81
    azzy81 about 11 years
    this helped me out. It was driving me mad with the editor auto wrapping my code when I didnt want it to. I couldnt find the option but this helped so ty ^^.
  • trve.fahad
    trve.fahad over 9 years
    right click on the left gutter (line numbers area) and choose Soft Wraps. a ver quick way to enable soft wraps per file
  • pavanw3b
    pavanw3b over 9 years
    File > Settings > Editor > Use Soft wraps in Editor.
  • Ryan
    Ryan over 8 years
    File > Settings > Editor > General > "Use soft wraps in editor"
  • JGallardo
    JGallardo over 8 years
    This must be really old, i could not find it
  • JGallardo
    JGallardo over 8 years
    @Ryan that option does not seem to exist anymore. Under General the option is not there.
  • Ryan
    Ryan over 8 years
    It is there for me, phpStorm v9.0.2 on ubuntu
  • bullcitydave
    bullcitydave over 8 years
    phpStorm for Mac v10.0: PhpStorm > Preferences > Editor > Use Soft wraps in Editor (as opposed to under the File menu)
  • Daniel
    Daniel about 6 years
    I am using PHP Storm on a Mac, 2017.3.4 and for me soft wraps only works in presentation mode.
  • LazyOne
    LazyOne about 6 years
    @dan No idea unfortunately (Windows user here). As far as I'm aware it works (saw no such tickets/complaints). The only other thing -- it may just not remember the setting when you setup to have only 1 tab opened at a time... so when switching between files it forgets the option...
  • Eryk Wróbel
    Eryk Wróbel almost 5 years
    Or just tap Left Shift key twice and type "soft wraps" and I will find if for You.
  • inumaru
    inumaru over 4 years
    you can actually use *.* for all type of file and extension.
  • Kyobul
    Kyobul about 4 years
    It is not, you have to do it per file.
  • Nico Haase
    Nico Haase almost 4 years
    Please add some explanation to your answer - is this triggered for all files with the same extension?
  • Peter Mortensen
    Peter Mortensen almost 3 years
    But the question is about PhpStorm. Please explain.