Enable soft wrap filtered by extension in Atom Editor

3

1

I am working with "text file formats" (like .md and .tex), as well as with "real programming languages".

I would like to have soft wrapping enabled only for a set of files, for example, .md, .tex, but not for .c, .h, .cpp, .py.

Now, I found that I could open my config.cson and create the next line

"*":
  "editor":
    "softWrap": true

but this, unfortunately, enables soft wraps for every file and they look awkward for C, Go, Python source files.

Atom soft wraps by default all .md files, even if the above configuration option is not included in the config.cson file. I would like to have soft wraps for my tex files to. How can I achieve this?

atom soft wraps md files, but not tex files

Vince Varga

Posted 2017-04-10T10:10:25.753

Reputation: 201

Answers

3

You need to find which package (scope?) controls the files you want to treat differently. The Atom Manual's "Basic Customization" page, "Language Specific Configuration Settings" section brings an example for this kind of customization that can be controlled from both the Settings View and the config.cson configuration file.

In my case, what I needed to do is adding the next lines to my config file

".text.plain":
  "editor":
    "softWrap": true

As I later installed yudai-nkt/language-tex package, I added

".latex.tex.text":
  editor:
    softWrap: true

These settings can be also modified from within the Atom GUI:

Edit
└─ Preferences
   └─ Packages
       └─(search for your language, pick a package)
          └─> Settings

Vince Varga

Posted 2017-04-10T10:10:25.753

Reputation: 201