Hard Wrap?


I’ve seen only one thread – posted in 2014 – that addresses hard wrapping of text. Is this a planned feature of Atom? Specifically, I would like the be able to activate hard wrapping from the syntax for a specific language.


You mean something like the autoflow package? It is only a manual process, not automatic.


Nope. A built-in feature. As in something I can turn on automatically (like soft wrap) or, as mentioned in the first post, something that could be turned on by a language syntax.


What I was looking for was a definition of the term “Hard Wrap”. I assume you mean that you want it to insert line endings for you to keep lines from getting too long?

If I am correct in my assumption, no, there are no plans for a built-in feature beyond the autoflow package.


Apologies, yes. Line returns. I format my Git commit messages with line returns after X characters, but doing so manually is a pain and a waste of time. I want to define a specific number of characters to wrap after in the syntax, so I can just open a commit message and type.


I have a package that can do this but it would be weird to use. It is box-edit. It allows drawing a box and typing in the box.


Interesting idea! But sadly not the cleanest solution. You draw the box before typing? If so, I feel like whatever logic is used to wrap the line at the edge of the box could easily be bundled in as a core function for prefered line length…


Not really. I use a textarea so it wouldn’t have anything to do with the actual editor. I didn’t propose that seriously. I use it for that but not very often.

A hard-wrap package wouldn’t be terribly hard to do.


Ahh. So much for reusing the same core concept. But yes, I feel like a hard-wrap would be simple, I just feel like it would make sense as a core feature…

(If I have some time, I may look into a package for it.)


For anyone stumbling upong this topic later: after a bit of hacking, I have my first Atom package: wraptor.

This is still an early idea, but for my use case (auto-wrapping git commit messages), it works! Currently, the package has two (undocumented) functions: First, for any text editor where the enabled: true flag is set in the config, the package will autowrap at the editor’s preferred line length. Second, the package exposes a single action command: Wraptor: Wrap Current Buffer, which, true to the name, will wrap the text in the current text editor, again to the preferred line length.



Thanks for this. It’s just what i was looking for!