Alex Bennee mentions the excellent longlines-mode in a recent post. I learnt something new – that it can highlight hard returns using (longlines-show-hard-newlines). Thanks Alex.
What is so good about it when you can wrap a paragraph at any time using M-q (fill-paragraph)? It wraps a paragraph in realtime as you are editing it, just like a word processor. And not only that, it uses soft newlines. If you cut and paste it, the result is not wrapped which is generally what you want.
I use longlines-mode a lot when I’m not editing source code. One thing I do is dump text in a scratch buffer (created with C-x b *random-name* <RET>) and then I press C-c C-l. Now I can look at two or more parts of the text at the same time using C-x 2 and related functions.
(defun set-longlines-mode () (interactive) (text-mode) (longlines-mode 1)) (global-set-key (kbd "C-c C-l") 'set-longlines-mode)
Just as Alex does, I use longlines-mode for writing my blog posts. However, I write most of my blog posts using muse so I add it to the muse-mode-hook.
(defun muse-minor-modes () (longlines-mode 1) (font-lock-mode 0)) (add-hook 'muse-mode-hook 'muse-minor-modes)