Created
October 15, 2016 20:05
-
-
Save saevarb/699086894abb1b92512050ae74661462 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(setq-local sbrg:pairs | |
'(("(" . ")") | |
("[" . "]") | |
("{" . "}") | |
("\"") | |
("\'") | |
)) | |
(dolist (pair sbrg:pairs) | |
(let* ((lhs (car pair)) (rhs (cdr pair)) fn) | |
(defun do-wrap (arg) | |
(interactive) | |
(sp-wrap-with-pair arg) | |
) | |
;; (message (format "%S" lhs)) | |
;; (message (format "%S" rhs)) | |
(define-key evil-visual-state-map (kbd lhs) (lambda () (interactive) (do-wrap lhs))) | |
(when rhs | |
(define-key evil-visual-state-map (kbd rhs) (lambda () (interactive) (do-wrap rhs))) | |
) | |
) | |
) | |
;; asdfasdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment