Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get emacs to word wrap when screen is split

By default emacs wraps long lines. However, when I split the screen using ctrl-x 3, then the two screens will truncate long lines. How do I get emacs to behave the same regardless of whether the screen is split or not. I want it to always wrap long lines, never truncate.

Thanks

like image 739
Mike Doll Avatar asked Jun 04 '13 16:06

Mike Doll


1 Answers

Put this in your initialization file:

(setq truncate-partial-width-windows nil)

Some background:

By default, Emacs switches to line truncation when the window width is less than 50 columns (by default). This is because using line continuation with narrow windows makes the text difficult to read. You can control the number of columns before Emacs switches to line truncation with the truncate-partial-width-windows variable. Setting it to nil means that Emacs will respect what is in your truncate-lines variable.

like image 154
Daniel Martín Avatar answered Sep 24 '22 18:09

Daniel Martín