How do I configure Emacs so that line wrapping does not break in the middle of a word?
I think what you probably want is "M-x toggle-truncate-lines". That toggles between wrapping or requiring you to scroll right and left to see the entire line. This is actually a way better answer than the accepted one.
By default, Emacs displays the current line number of the point in the mode line. You can toggle this feature off or on with the command M-x line-number-mode , or by setting the variable line-number-mode .
Modes such as Long Lines wrap lines on word boundaries as you type, by inserting temporary line-ending characters. These are removed when you save the buffer to a file or copy its text for yanking elsewhere, so they are only for display purposes.
If you want to emulate the behavior of an editor like Notepad, you might want to turn on visual line mode. While setting word-wrap will cause line wrapping at word boundaries, any action you take on a line (e.g., moving up/down or killing) will still respect the newline character. Visual line mode will treat each display line as though it had a newline at the end.
(visual-line-mode t)
Line to add in .emacs file:
(global-visual-line-mode t)
M-x toggle-truncate-lines disable allows you to disable visually line breaking.
M-x auto-fill-mode + M-q allows you to word wrap for real a pre-existing paragraph.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With