Skip to content

Instantly share code, notes, and snippets.

@v2e4lisp
Created April 29, 2014 13:55
Show Gist options
  • Select an option

  • Save v2e4lisp/11401104 to your computer and use it in GitHub Desktop.

Select an option

Save v2e4lisp/11401104 to your computer and use it in GitHub Desktop.
shift text to left
(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