In the comments on my post on deleting whitespace, Vargonaut pointed out the useful function cycle-spacing
. This function, when called multiple times, cycles through
- replacing all spaces with a single space
- removing all spaces
- restoring the original spacing
As Vargonaut recommends, it is convenient to bind this to M-SPACE
in place of the just-one-space
function. Do this with
;; cycle through amounts of spacing (global-set-key (kbd "M-SPC") 'cycle-spacing)
Here is an animation of this in action