Alex Rivera | Logout

Emacs word wrap at a specific column number

Asked 2012-01-07T19:40:42.287
47

I like to run my editor full-screen. The only thing is, though, that when I do this, the word wrap only kicks in when the line hits the right edge of the screen. I would like it to do so, already when the line hits, say, column number 200.

How do I do that?

I would like it to happen in all modes, e.g., Org-mode. I added the line (global-visual-line-mode t) to my .emacs file, in order for the word wrapping also to work in org-mode.

I'm running Emacs 23.


I got it working! Here is what I added to my .emacs file to make it happen:

(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'text-mode-hook
  '(lambda() (set-fill-column 80)))
Edit
Report

1 Answer

25

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.

answered 2012-01-07T20:33:52.737

Your Answer