Emacs word wrap at a specific column number
Solution 1:
Type M-x auto-fill-mode to activate automatic line-wrapping after a certain column. Then set the actual line width through the variable fill-column
as described by user choroba (C-x f).
Note though that this works a bit differently from what other text editors do. M-q will re-format the current paragraph.
Solution 2:
You can set the line width with C-xf (set-fill-column
).
Afterwards, you might need to hit M-q to reformat the current paragraph (fill-paragraph
), or select text to be justified and run fill-region
.
Solution 3:
The suggestion for turn-on-auto-fill
will work if you want hard newlines in the files you're editing. If not, and you just want word-wrap, consider instead visual-fill-column-mode
, which just does the normal word-wrap that would happen at the edge of the window, but at the specified fill-column
.
Solution 4:
See the Emacs manual (C-h r), node Filling
. See in particular the first subnode in the menu, Auto Fill
.