Skip to content

Instantly share code, notes, and snippets.

@shogo82148
Created March 4, 2016 00:52
Show Gist options
  • Save shogo82148/43e7253e745f3ab3f2f1 to your computer and use it in GitHub Desktop.
Save shogo82148/43e7253e745f3ab3f2f1 to your computer and use it in GitHub Desktop.
{% trans %} {% endtrans %}
(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