fill-paragraph is probably among the most underappreciated Emacs commands. I
use it dozens of times a day, and never stop to think of just how awesome and
practical it is. Still, we can make it a little bit better. Every once in a
while I need to “unfill” (or “unwrap”) a paragraph that’s broken over many
lines.
By being clever enough, we can make this into a free feature. There’s never any
reason to hit M-q twice on the same paragraph, so we can use that as our
keybind for the “unfill” command.
With this, M-q will act as a toggle. Hitting it once will do its usual thing
(even if the paragraph is already filled), but hitting it twice will completely
unwrap the current paragraph into a single line.
Fill and unfill paragraphs with a single key
31 May 2016, by Artur Malabarba.fill-paragraph
is probably among the most underappreciated Emacs commands. I use it dozens of times a day, and never stop to think of just how awesome and practical it is. Still, we can make it a little bit better. Every once in a while I need to “unfill” (or “unwrap”) a paragraph that’s broken over many lines.By being clever enough, we can make this into a free feature. There’s never any reason to hit M-q twice on the same paragraph, so we can use that as our keybind for the “unfill” command.
With this, M-q will act as a toggle. Hitting it once will do its usual thing (even if the paragraph is already filled), but hitting it twice will completely unwrap the current paragraph into a single line.
Tags: keybind, convenience, init.el, emacs,
Provide input to the compilation buffer »
« A review of Mickey Petersen’s “Mastering Emacs” book, for beginners and advanced users
Related Posts
A quick guide to directory-local (or project-specific) variables in convenience
A few paredit keys that take over the world in keybind
Disable Mouse only inside Emacs in keybind
Content © 2019, All rights reserved. Icons under CC3.0.