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?

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

2 Answers 2

4

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

1
  • 1
    There is also org-fill-paragraph that also aligns tables and such.
    – erikstokes
    Commented Sep 6, 2015 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)))
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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