Is it possible to wrap text automatically at 80 column length? I mean, writing code or text and then, when I reach 80 characters, put a breakline and continue on the next line (not wrapping the word but putting on the next line).
Thank you!
Is it possible to wrap text automatically at 80 column length? I mean, writing code or text and then, when I reach 80 characters, put a breakline and continue on the next line (not wrapping the word but putting on the next line).
Thank you!
You can customize fill-column
or do (setq-default fill-column 80)
in your init file and use auto-fill-mode
.
You can activate it per mode by using (add-hook 'text-mode-hook 'turn-on-auto-fill)
or with key binding: (global-set-key (kbd "C-c q") 'auto-fill-mode)
. See emacswiki for more.
I know you asked for "automatically" (and 5 years ago...) but...
I do it manually with the command fill-paragraph
(M-Q
). Having (setq fill-column 80)
in the init file. It even understands some text structure, e.g. that the text is a comment. Which could be good or bad, depending on your needs.
auto-fill-mode
? – theldoria Jul 24 '16 at 11:23emacs -Q
(no init file). If you still see a problem then provide a step-by-step recipe to reproduce it, saying what you see at each step and what you expected to see. If you do not see a problem, withemacs -Q
, then recursively bisect your init file to find where you are introducing the problem. – Drew Jul 24 '16 at 15:47