How to disable "soft wrap" with a single file?


#1

I know I can configure this option in language-specific settings, but how can I alter it for a specific file when I work with the same language, such LaTeX ?

I would like to enable it in a main.tex file, while disable it in a subfile.tex (for soft wrapping will mess formatted long-coded tables).


#2

Try the following code in your init.coffee ->

atom.workspace.observeActiveTextEditor (editor) ->
  if editor?
    if editor.getTitle() is 'subfile.tex'
      editor.setSoftWrapped(false)
  
atom.workspace.observeTextEditors (editor) ->
  if editor?
    if editor.getTitle() is 'subfile.tex'
      SetWrap = (ed) ->
        ed.setSoftWrapped(false)
      setTimeout ->
        SetWrap(editor)
      , 800

#3

@danPadric Wow, that works! Thanks a lot!