Created
April 29, 2014 13:55
-
-
Save v2e4lisp/11401104 to your computer and use it in GitHub Desktop.
shift text to left
This file contains hidden or 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 shift-left (n) | |
| ;; shift a block of text by n space | |
| (interactive "nHow many spaces? :") | |
| (save-excursion | |
| (save-restriction | |
| (narrow-to-region (region-beginning) | |
| (region-end)) | |
| (beginning-of-buffer) | |
| (while (< (point) (point-max)) | |
| (beginning-of-line) | |
| (insert (s-repeat n " ")) | |
| (forward-line))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment