0

I'm trying Doom Emacs and immediately miss my hard wrap after 80 cols such as

(setq-default fill-column 80)
(setf fill-column 80)
(add-hook 'latex-mode-hook #'auto-fill-mode)
(add-hook 'prolog-mode-hook #'auto-fill-mode)

Would anyone know how I can implement such hard wrap rules in Doom Emacs? Thanks in advance!

1 Answer 1

0

Do you mean (visual-line-mode t) ? This will wrap lines without changing the contents of the buffer. By contrast, (auto-fill-mode t) will insert line breaks at the fill-column, as one types. To wrap already-existing paragraphs, you may use M-x fill-paragraph, typically bound to M-q.

In your example code, your hooks might be improved by using turn-on-auto-fill as recommended in the EmacsWiki. For example, (add-hook 'prolog-mode-hook 'turn-on-auto-fill)

2
  • Please expand on why this an answer to the question. IIUC, the OP is asking for hard (not visual) wrapping. May 15, 2023 at 18:32
  • @FranBurstall, thank you for the clarifying suggestion. I've edited my post to add extra detail, which I hope helps. May 16, 2023 at 19:50

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.