Created
December 6, 2013 10:35
-
-
Save LouisKottmann/7821725 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun align-regexp-lefty () | |
"After using align-regexp, this will move spaces to the left." | |
(interactive) | |
(let (pos1 pos2) | |
(if (region-active-p) | |
((setq pos1 (region-beginning) pos2 (region-end)) | |
(save-restriction | |
(narrow-to-region pos1 pos2) | |
(goto-char (point-min)) | |
(while (re-search-forward "\(\w+\)\ \(\ *\)" nil t) | |
(replace-match "\2\1"))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment