Last active
August 29, 2015 14:01
-
-
Save psachin/a9cdd03437b3d0c8b9fe to your computer and use it in GitHub Desktop.
Wrap word or region inside user specified input. like <>," ",' ',[ ], etc.
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 surround(tag) | |
"Surround content within html TAG. | |
TAG can be <>," ",' ',[ ], etc." | |
(interactive "sWord should be inside: ") | |
(backward-word) | |
(mark-word) | |
(when (region-active-p) | |
(kill-region (region-beginning) (region-end))) | |
(insert tag) | |
(backward-char) | |
(yank)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment