43

I'd like to have soft wraps in the WebStorm editor only by Markdown files. According to Word wrapping in phpstorm this can be achieved only with Menu | View | Active Editor | Use Soft Wraps. I really don't want to have soft wraps by coding, but I don't want to use the menu every time I open an .md file.

Isn't there a way to assign this behavior for example to language or to file type?

Community
  • 1
  • 1
inf3rno
  • 24,976
  • 11
  • 115
  • 197
  • 1
    *"Isn't there a way to assign this behavior for example to language or to file type?"* No as it's an IDE-wide setting. It's either On or Off for all files with option to change it for current file manually (and this override is not saved anywhere/valid until file or project is closed). If such option would be supported by `.editorconfig` files .. and if IDE would read it from there .. then it could be done this path as `.editorconfig` *can have* settings that should be applied to certain files only. – LazyOne Oct 09 '16 at 23:03
  • @LazyOne I don't think we have that feature. https://github.com/editorconfig/editorconfig/issues/168 – inf3rno Oct 13 '16 at 09:34

3 Answers3

124

It's 2019, and users of JetBrains apps now have automatic soft-wraps for Markdown documents - rejoice!

Alas it is not enabled by default, so you'll need to visit your preferences and check a box: On WebStorm 2019.2 at least, navigate to Editor > General > Soft Wraps and click your way to Markdown-soft-wrap bliss.

Screenshot of the WebStorm preferences panel

sherb
  • 5,845
  • 5
  • 35
  • 45
  • I still have the old version, I don't like the annual licensing. For now it is ok, later I'll think about using a different IDE or buying the annual license. It is just not priority now. – inf3rno Oct 29 '19 at 23:46
  • I have version 2020.3.2 and this worked for me. Thank you. – Doug Wilhelm Mar 12 '21 at 20:49
  • 1
    Cool, that helped! Is there also a way to configure the soft-wrap to happen after a fixed number of characters rather than depending on the viewport? – Franz Feb 18 '22 at 10:17
22

I found an acceptable solution to do this:

  1. Go to "Settings" -> "Keymap".
  2. Look for "Main menu" -> "View" -> "Active Editor".
  3. Assign a keyboard shortcup to "Use Soft Wraps" (for instance: Ctrl + Alt + w).

Now when you are editing a file, use this shortcut and it will enable the soft wraps only for this file.

Dim'
  • 518
  • 6
  • 12
  • Thanks! I will check this at weekend. – inf3rno Feb 01 '17 at 13:12
  • I read it. I knew that it can be done by active editor, so this is almost the same as doing this from menu. I wanted to do this automatically, not manually, but I accept this, since there is no better solution yet afaik. – inf3rno Feb 02 '17 at 20:33
  • While useful, this doesn't answer the question, which is how to have the editor _automatically_ soft-wrap only certain filetypes. – Daniel A. Thompson Sep 04 '21 at 11:31
3

You can configure this in .editorconfig and it will work in any JetBrains IDE that supports .editorconfig (hopefully all of them).

[*.md]
ij_any_wrap_long_lines = true
Steve
  • 8,066
  • 11
  • 70
  • 112