Created
March 4, 2016 00:52
-
-
Save shogo82148/43e7253e745f3ab3f2f1 to your computer and use it in GitHub Desktop.
{% trans %} {% endtrans %}
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 wrap-region-by-string () | |
(interactive | |
(let ((start-point (region-beginning)) | |
(end-point (region-end))) | |
(save-excursion | |
(goto-char start-point) | |
(insert "{% trans %}") | |
(goto-char (+ end-point (length "{% trans %}"))) | |
(insert "{% endtrans %}"))))) | |
(global-set-key "\C-xw" 'wrap-region-by-string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment