Turn off wrapping for a single buffer using
(set-default 'truncate-lines t)
This setting does not apply to horizontally-split windows.
‘C-x 3’ splits windows horizontally, where as
‘C-x 2’ splits them vertically.
To turn wrapping on in horizontally-split windows, use the following in your InitFile:
(setq truncate-partial-width-windows nil)
We don’t recommend it, either, because horizontally split windows are usually too small to read anyway. Note that this variable is not buffer-local.
See LineWrap for more info.
See PhysicalLineMove for a minor-mode that changes line movement commands (C-n, C-p, C-a, C-e) to take into account wrapped lines; useful if you don’t want to truncate lines!
If you want to set truncate-partial-width-windows just for a certain mode, you need to put the setting in a hook:
(add-hook 'diff-mode-hook (lambda () (setq truncate-lines t)))
Nano truncates lines so that when you scroll toward the end of one, the line itself moves to the left independently of the rest of the text. I’ve had a surprisingly hard time finding any talk of this feature in emacs. Is it possible?