2

I use org-mode mainly to write extensive notes, but I'm finding it difficult to "justify" while refactoring or making changes.

For example, suppose I have to make changes to the following text:

* Heading

  A line of nearly 80 characters that ends with newline character
  remaining part of the line

If I've to add few words in first line (after heading), then the text will look like

* Heading

  A line of nearly 80 characters (plus some random stuff in brackets)
  that ends with newline character
  remaining part of the line

But ideally, I want something like

* Heading

  A line of nearly 80 characters (plus some random stuff in brackets)
  that ends with newline character remaining part of the line

Is there some way in which I can automate this "justification" using org-mode?

  • 1
    M-q while in the paragraph with misaligned text? Or are you looking to do that automatically for the whole file? – wvxvw Sep 5 '15 at 9:03
  • @wvxvw I wasn't aware of fill-paragraph. Thanks! – jdoicj Sep 5 '15 at 9:39
4

The requirement can be solved by usingM-q or M-x fill-current-paragraph. Refer GNU Emacs Manual: Explicit Fill Commands.

  • 1
    There is also org-fill-paragraph that also aligns tables and such. – erikstokes Sep 6 '15 at 2:35
1

If you add to your org hook, you won't have to keep manually calling M-q.

     (add-hook 'org-mode-hook '(lambda ()
                              (visual-line-mode)
                              (org-indent-mode)))

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.