2

In orgmode, how can I get below line wrap behavior:

  1. for text (other than table), I wish line wrapped.
  2. for table, I do not wish it's wrapped.

I can add below line in init.el

(global-visual-line-mode t)

But table will be wrapped also!

How can I line wrap except org tables?

1

In order to wrap the lines and not the table in org-mode you can fill the paragraph your courser is on (in this example using M-q) instead of choosing wrap over truncate.

borrowing the following function from @fniessen in Paragraph filling for org-mode inside latex environment in SO

(defun leuven-good-old-fill-paragraph ()
  (interactive)
  (let ((fill-paragraph-function nil)
        (adaptive-fill-function nil))
    (fill-paragraph)))

adding this local key binding:

(define-key org-mode-map "M-q" 'leuven-good-old-fill-paragraph)

Now you can selectively wrap the paragraphs and leave out the tables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.