After quite a lot of experimentation, I think that I like:
(setq truncate-lines nil)
(setq word-wrap t)
for text editing, but
(setq truncate-lines t)
(setq word-wrap nil)
for programming.
In all modes, I like:
(setq fill-column 80)
so that I can use M-q
and C-u M-q
to flow text to 80 columns, but I also find that I dislike auto-fill
mode and would never like it to be on.
I'm also not that keen on visual-line-mode
(or at least the bit of it that isn't word-wrap
)
Is there some incantation I can put in my .emacs
file that will make me happy?
I define happy to be: 'it all just does what I want and I need never think about this again'.
Use prog-mode-hook
and text-mode-hook
to set these variables:
(add-hook 'text-mode-hook '(lambda ()
(setq truncate-lines nil
word-wrap t)))
and
(add-hook 'prog-mode-hook '(lambda ()
(setq truncate-lines t
word-wrap nil)))
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