Skip to content

Instantly share code, notes, and snippets.

@EricCrosson
Last active December 15, 2015 14:29
Show Gist options
  • Save EricCrosson/54cb70705fd64d9e67d6 to your computer and use it in GitHub Desktop.
Save EricCrosson/54cb70705fd64d9e67d6 to your computer and use it in GitHub Desktop.
Some defuns to insert pairs of useful programming delimeters.
(define-key global-map (kbd "C-M-j")
(defun insert-surrounding-parentheses (&optional arg)
(interactive "p")
(dotimes (i arg) (insert "()")
(backward-char 1))))
(define-key global-map (kbd "C-M-k")
(defun insert-surrounding-braces (&optional arg)
(interactive "p")
(dotimes (i arg) (insert "{}")
(backward-char 1))))
(define-key global-map (kbd "C-M-l")
(defun insert-surrounding-brackets (&optional arg)
(interactive "p")
(dotimes (i arg) (insert "[]")
(backward-char 1))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment