As simple as that. Everytime I export from orgmode to text the lines are wrapped. How to disable this?
Thank you,
E.
John Kitchin initially wrote a simple program to do this. He then improved it and made it into ox-clip a org-mode based Emacs package, which is easy to get through Melpa's repository. Not only does it avoid wrapping text, it also preserves the format on the clipboard so that it is a breeze to paste.
ox-clip may need you to install a clipboard manager depending on your system. Specific installation instructions can be found here.
Org-mode provides the customization variable org-ascii-text-width
. If you set this to a large enough value, it has the effect of not wrapping text blocks during export to plain text.
However, doing this also does weird things to text that the exporter tries to present as centered titles and subtitles. That applies to the contents of #+TITLE:
and #+AUTHOR:
lines, and probably other similar options. You can turn these off via the customization variables org-export-with-title
and org-export-with-author
. I don't see any obvious way of modifying the title formatting in a way that wouldn't get mangled by long lines.
Once in a while, I'm drafting e-mails in an orgmode buffer. I'd like to export the plain text, but without wrapped lines. Usually I forget to disable auto-fill-mode while writing.
So after finishing the text, I copy it into scratch, mark it and then:
M-x replace-string Ctrl-q Ctrl-j Ctrl-q Ctrl-j RET XXXX RET
. Result: Every new paragraph is replaced by XXXX.
Next step:
M-x replace-string Ctrl-q Ctrl-j RET <space> RET
: I'm replacing the single newlines with a singel space.
Next step:
M-x replace-string XXX RET Ctrl-q Ctrl-j RET
: I'm replacing the XXXX against the former new paragraphs.
Ready for copy and paste.
After OP made a comment about the #+OPTIONS:
, I found that you can write #+OPTIONS: \n:nil
into the preamble of the org file, which is supposed to toggle whether to preserve line breaks (`org-export-preserve-breaks').
Then -- thanks to Tyler -- I customized org-ascii-text-width. Set it to 10000 and you don't get a line break. But unfortunately the exporter assumes the pagewidth were that large and pushes the sections and the title _far_far_ away.
#+OPTIONS
?
Commented
Aug 18, 2017 at 11:57
ox-pandoc
to plain text. Pandoc includes an--wrap=none
command line option.