Skip to content

Instantly share code, notes, and snippets.

@LouisKottmann
Created December 6, 2013 10:47
Show Gist options
  • Save LouisKottmann/7821845 to your computer and use it in GitHub Desktop.
Save LouisKottmann/7821845 to your computer and use it in GitHub Desktop.
(defun align-regexp-lefty(beg end)
"After using align-regexp, this will move spaces to the left."
(interactive "*r")
(save-restriction
(narrow-to-region beg end)
(save-excursion
(goto-char (point-min))
(while (search-forward-regexp "\(\w+\)\ \(\ *\)" nil t)
(replace-match "\2\1" nil nil)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment